I have a problem when calling Closes[3][0] as it is not capturing the latest bar in the history but the second latest one in the history. May be this is due to time zone issue? But I am thinking to write some codes to specifiy Closes of a date according to the history data, is it possible? say I want to get 12/12/2009 daily close, how to do it?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Closes Issue
Collapse
X
-
Closes Issue
Hi
I have a problem when calling Closes[3][0] as it is not capturing the latest bar in the history but the second latest one in the history. May be this is due to time zone issue? But I am thinking to write some codes to specifiy Closes of a date according to the history data, is it possible? say I want to get 12/12/2009 daily close, how to do it?Tags: None
-
Hello NingNing,
This most likely has to do with the sequence of OnBarUpdates()
Daily bars are time stamped with the time the bar will end, and this will often be later than the primary series you are evaluating.
When using version 6.5 it is advised that any secondary series must be smaller than the first.
You can use GetBar() to return the bars ago value of a specific date / time. This reference sample can help with this:
Ryan M.NinjaTrader Customer Service
-
HI
I still struggle with it. Let me explain my problem again. I am backtesting from 1/8 to 12/8, and now is 12/8 in asia time. I have 1/8 to 11/8 FTSE cash index from YAHOO in Ninja. But when I do Add("FTSE", PeriodType.Day, 1) and do Closes[3][0]. The value is actually the one on 10/8 instead of 11/8 that I am expecting. Again, I am running it in asian time on 12/8 and FTSE has not yet closed on 12/8 so there is no new close data from yahoo. 11/8 close data is the last one I have. thx again
Comment
-
NingNing, for 6.5 please use the daily as primary, so you can add the (faster) 5 min one...then print the BarsInProgress and Time of the call to the output window to see how the call sequence works -
Code:if (BarsInProgress == 0) Print(BarsInProgress + " " + Time[0]); if (BarsInProgress == 1) Print(BarsInProgress + " " + Time[0]);
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
581 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
337 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 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
554 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
552 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment