Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Last bar in other time frame
Collapse
X
-
Last bar in other time frame
Is there a way to check the last bar of 5 minute time frame while the indicator run in 1 minute time frame?Tags: None
-
Hello edward_bell,
Thanks for your post.
Can you provide more context to your question as there is not enough info to assist with? Can you further describe what you are trying to do?
Is the question pertaining to an indicator or strategy script? If so have you added the 5 minute data series to it?Paul H.NinjaTrader Customer Service
-
It is an indicator running on 1 minute chart and I already added the 5 minute time frame in the Initialize section. I just want to know if the bar is the last close historical bar in 5 minute chart.
Comment
-
Hello edward_bell,
Thanks for your reply.
Assuming that the 5 minute data series is the only added data series. If you are running with CalculateOnbarClose = true then you can refer to the close of the last historical bar with Closes[1][0] where 1 refers to the 5 minute added data series and [0] refers to the last completed 5 minute bar.
If you are using CalculateOnBarClose = false, and connected to live or replay data, then use Closes[1][1] where the first 1 refers to the 5 minute data series and the second 1 will refer to the last completed bar of the 5 minute data series. Note that in this case Closes[1][0] would refers to the currently forming 5 minute bar.
For a complete understanding please review: http://ninjatrader.com/support/helpG...nstruments.htm in particular the section " How Bar Data is Referenced " for a good illustration of the differences.Paul H.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by f.saeidi, Today, 12:14 PM
|
7 responses
16 views
0 likes
|
Last Post
by f.saeidi
Today, 01:32 PM
|
||
Started by Russ Moreland, Today, 12:54 PM
|
1 response
6 views
0 likes
|
Last Post Today, 01:01 PM | ||
Started by philmg, Today, 12:55 PM
|
1 response
7 views
0 likes
|
Last Post Today, 01:00 PM | ||
Started by TradeForge, 04-19-2024, 02:09 AM
|
2 responses
32 views
0 likes
|
Last Post
by TradeForge
Today, 12:32 PM
|
||
Started by aprilfool, 12-03-2022, 03:01 PM
|
3 responses
329 views
0 likes
|
Last Post Today, 12:31 PM |
Comment