- DJB
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Forex Sessions Issue
Collapse
X
-
Forex Sessions Issue
In Strategy Analyzer, if you run a backtest for one day (beginning and ending on the same date) on a Forex instrument, the backtest will really run for 48 hours: 5 pm of the previous day through to 5 pm of the day following the begin & end date. In fact, it seems to always do 24 hours more than the intended optimization period because it will go to 5 pm of the next day after the end date. This bug only appears on time frames that continue across 12 midnight - stocks and others aren't affected like the Forex instruments are.
- DJBTags: None
-
Daniel, thank you for the information. As far as I'm aware, those times are slightly arbitrary because the open/close of forex trading sessions are more-or-less determined by the broker. IB, for example, opens and closes forex trading at 19:00 EST while GAIN opens and closes at 22:00 LST.
I ran the 24/7 template and got 2 days worth of backtest as well.AustinNinjaTrader Customer Service
Comment
-
I agree that it is true the exact times that a session begins/ends are arbitrary. However, I find that whenever a session template is used that crosses midnight, each 24 day will have part of two sessions and then NT will use both sessions for the one day. On three days, it'll use 4 sessions, etc, always using one more session because it takes the sessions at the end and the beginning. Then, when I do a leapfrog walk-forward where say, it does a walk forward for 3 days, and continues.... the final output is the *sum* of the walk forwards. Since each walk forward included one extra session than needed, there is overlap on the times and the final sum is off due to the accumulated overlap. This, I certainly think is a bug that needs to be corrected.
Oh, and my note about 2010 really turned out to be due to the fact that when a day is next to the weekend, it only can do one session and not the one for the weekend. To clarify, a backtest on Wednesday only will run from say 5 pm on Tuesday to 5 pm on Thursday. But, a backtest on Friday will run from 5 pm on Thursday to 5 pm on Friday but can't go beyond that because the market is closed. Also, one on Sunday will run from 5 pm Sunday to 5 pm on Monday. So, with calculations possibly being 24 or 48 hours depending on which day, results are very inconsistent. If NT was made to always take only the first session of two possible sessions in a day, everything would be fixed and consistent... unless a day was purposefully split into multiple sessions during the day so more programming would be needed to work it all out, but wouldn't be hard.
Comment
-
This is expected behavior. As a workaround you could create a session that starts at 12:00am and ends at 11:59pm the same day.Last edited by NinjaTrader_Austin; 07-13-2010, 03:38 PM.AustinNinjaTrader Customer Service
Comment
-
I see....
I have programmed into the strategy quite a lot using rules that I outlined in the previous post to allow it to determine if it should trade or not from its present session... to still keep whatever session I choose instead of hard programming begin/end times... but to leave it in NT as an expected behavior for people to haphazardly discover when it'd take 20 minutes to fix is... odd.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
599 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
345 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
558 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
558 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment