Also is there a method to get a bar number that starts at a specified time?
Announcement
Collapse
No announcement yet.
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 Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
571 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
330 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
548 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
549 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment