Also is there a method to get a bar number that starts at a specified time?
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
Time[0] - time of open or close of the bar?
Collapse
X
-
Hello Gregid,
Time[0] will return the bar timestamp.
Note that time based charts have the bar timestamp at the end of the time interval. Meaning if it is 9:30 and you have a one minute chart then the bar being built will be 9:31
If you have a Tick based chart it will return when the new bar starts to build.
If you can use CurrentBar to return the number of bars that are throughout the chart from Right to Left.
Let me know if I can be of further assistanceCal H.NinjaTrader Customer Service
-
Thanks Cal,
So if I want to know open and close time and am accessing range bar, the Time[32] will be the open of the bar #32 (0 indexed) and Time[31] its close time, am I correct?
As to the second question - I am trying to get values of secondary BarsArray that are within primary bar and tried to avoid looping through entire BarsArray to get the values, so I understand there is no specific method to get bar number by providing time?
- Likes 1
Comment
-
Hello Gregid,
Correct, as the last tick of a bar is the first tick of the next bar.
For the second question, BarsArray[0].GetBar(); should get you what you are looking for.
http://www.ninjatrader.com/support/h...?barsarray.htmCal H.NinjaTrader Customer Service
- Likes 1
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by pmachiraju, 11-01-2023, 04:46 AM
|
8 responses
148 views
0 likes
|
Last Post
by rehmans
Today, 06:44 PM
|
||
Started by mattbsea, Today, 05:44 PM
|
0 responses
5 views
0 likes
|
Last Post
by mattbsea
Today, 05:44 PM
|
||
Started by RideMe, 04-07-2024, 04:54 PM
|
6 responses
33 views
0 likes
|
Last Post
by RideMe
Today, 05:31 PM
|
||
Started by tkaboris, Today, 05:13 PM
|
0 responses
5 views
0 likes
|
Last Post
by tkaboris
Today, 05:13 PM
|
||
Started by GussJ, 03-04-2020, 03:11 PM
|
16 responses
3,282 views
0 likes
|
Last Post
by Leafcutter
Today, 04:14 PM
|
Comment