Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Delay execution
Collapse
X
-
Delay execution
Issue: When criteria is met on the last bar of the session, the trade is automatically executing at the open of the next session. I use calculate on close=true on my strategy, but when this scenario happens, the trade will execute at the opening tick of the next session. How to avoid? Please advise?Tags: None
-
I don't want the order to submit at all. I would like the strategy to start over at the beginning of the session, not take entries based off conditions from the previous session. This is how the system backtest, but when it runs in real time, it triggers orders based on the previous session's last bar. The TIF setting may be way to go though, but then again even if I use Day instead of GTC, the system apparently doesn't know what day it is when the session starts anyway so they may not work either. Any thoughts?
Comment
-
dancorcal,
This all depends on how you program your strategy. By default your strategy takes all of the data and just keeps continuing its calculations across sessions. If you want it to stop and start afresh on each session you would need to program it in a manner that facilitates this.
Easiest way for this is to prevent any entries on the last bar of the previous session. So let us say the closing time of the last bar of a session is 4PM. Then you could do something like this in OnBarUpdate()
Code:if (ToTime(Time[0]) == 160000) return;
Josh P.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by maybeimnotrader, Yesterday, 05:46 PM
|
1 response
18 views
0 likes
|
Last Post Today, 07:28 AM | ||
Started by Perr0Grande, Yesterday, 08:16 PM
|
1 response
7 views
0 likes
|
Last Post Today, 07:22 AM | ||
Started by f.saeidi, Yesterday, 08:12 AM
|
3 responses
25 views
0 likes
|
Last Post Today, 07:18 AM | ||
Started by algospoke, Yesterday, 06:40 PM
|
1 response
15 views
0 likes
|
Last Post Today, 07:16 AM | ||
Started by quantismo, Yesterday, 05:13 PM
|
1 response
14 views
0 likes
|
Last Post Today, 07:12 AM |
Comment