Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Mixed time frames
Collapse
X
-
Yes, from the tests I did, it occurred at midnight. Subsequent tests of GetSessionBar also refer to the YM
Run without time constraint -
28/02/2008 00:00:00 session close is: 12582.18 time 28/02/2008 00:00:00
28/02/2008 00:01:00 session close is: 12526 time 28/02/2008 00:00:00
Run with time constraint of after 16:00 and less than 16:03, I get
28/02/2008 16:01:00 session close is: 12526 time 28/02/2008 00:00:00
28/02/2008 16:02:00 session close is: 12526 time 28/02/2008 00:00:00
Comment
-
You will need to play around more. It works as expected indpendant of session settings.
If you create a strategy with only the following code in OnBarUpdate() on one series you will see proof in the Output window.
if (Bars.GetSessionBar(1) != null)
Print(Time[0].ToString() + " " + Bars.GetSessionBar(1).Time + " " + Bars.GetSessionBar(1).Close);
RayNinjaTrader Customer Service
Comment
-
Having some what of a similar problem but I am using Daily (primary) and weekly (secondary) data. Using Print() statements I see:
2/29/2008 12:0:00AM[0]
2/29/2008 12:00:00AM[1]
3/3/2008 12:00:00AM[0]
3/4/2008 12:00:00AM[0]
3/5/2008 12:00:00AM[0]
3/6/2008 12:00:00AM[0]
This is running the Strategy Analyzer on Sunday, March 9th. As you can see, there is no daily entry 3/7/2208 or a weekly entry for 3/7/2008. Looks like it will not consider Friday to be complete until Monday's data has been added.
I have played around with the session parameters and that has not gotten NT to consider Friday to be complete. I double checked the chart and the chart is showing a daily bar for 03/7/2008.
Is there something I'm missing or is this the way NT works?
Thanks
Comment
-
When CalculateOnBarClose is set to true (which is the setting for backtesting) it will not include the final bar because it does not know that it has "closed" yet. This is the way NT works with historical data. In real-time you can set CalculateOnBarClose to false and you will get prints on the final bar.Josh P.NinjaTrader Customer Service
Comment
-
Ray,
I set the daily data up as 1 minute at 4 pm (160000). I then accessed the data as minute data and NT obliged. Obviously not the correct solution but it will do for the time being.
e.g.
20080228 160000;12689.28;12713.99;12463.32;12582.18;3938580
20080229 160000;12579.58;12579.58;12210.3;12266.39;4426730
Eric
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
626 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
359 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 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
562 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
567 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment