Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Entry at open
Collapse
X
-
tjendra,
An order submitted with CalculateOnBarClose = true gets filled on the next bar. Not possible to have an order filled at market open from a submission at market open when using CalculateOnBarClose = true. The order has to have come from before market open. It was likely generated on the last bar before the new session and filled on the market open because that is the next tradeable location.Josh P.NinjaTrader Customer Service
Comment
-
What you said here is exactly what I think happened. But doesn't stopping the strategy and restarting it stop this from happening? There should be no carry over trade from the last trading day given all strategies would have stopped at the end of the trading session.Originally posted by NinjaTrader_Josh View PostThe order has to have come from before market open. It was likely generated on the last bar before the new session and filled on the market open because that is the next tradeable location.
Comment
-
Stopping a strategy and restarting it just means the strategy goes and recalculates everything again. If it saw a submission at the end that was not explicitly cancelled by the strategy then it will try and place that in.
A. Don't submit that order
B. Cancel that order explicitly in the strategyJosh P.NinjaTrader Customer Service
Comment
-
How do I implement A or B solution in the strategy? Do I test using IOrder objects at 4pm? If you can provide some advice, it would be very helpful. Thanks.Originally posted by NinjaTrader_Josh View PostStopping a strategy and restarting it just means the strategy goes and recalculates everything again. If it saw a submission at the end that was not explicitly cancelled by the strategy then it will try and place that in.
A. Don't submit that order
B. Cancel that order explicitly in the strategy
Comment
-
The first step is to figure out exactly what the scenario is. To do this you need to use TraceOrders = true and see what the outputs are around the switch from market close to a new market open. Then you can tailor a solution when you figure out what exactly is happening.Josh P.NinjaTrader Customer Service
Comment
-
If all that's happening is that the strategy wanted to enter long/short after evaluating the strategy at the 4:00pm bar without knowing that the session will end after 4:00pm?Originally posted by NinjaTrader_Josh View PostThe first step is to figure out exactly what the scenario is. To do this you need to use TraceOrders = true and see what the outputs are around the switch from market close to a new market open. Then you can tailor a solution when you figure out what exactly is happening.
All I want to do here is cancel any pending order that still exists after 4:00pm so that it doesn't execute on market open.
Comment
-
Thanks, I think your solution should work. I will need to place this codeOriginally posted by NinjaTrader_Josh View PostYes. Or you can stop your strategy when 4PM hits.
You may even need to return before that last bar too with >=.Code:if (ToTime(Time[0]) > 160000) return;
if (ToTime(Time[0]) >= 160000)
return;
right in the beginning of OnBarUpdate() right? So that it doesn't evaluate the 4pm bar.
This shouldn't affect the Exit on close orders right?
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
24 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
120 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
63 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
41 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
45 views
0 likes
|
Last Post
|

Comment