&& Time[0].Date == DateTime.Today
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Order execution error in ZB and RTY contracts
Collapse
X
-
Order execution error in ZB and RTY contracts
I use daily RTH session bars for a strategy that occasionally, mostly in the ZB and RTY contracts, takes a Tuesday opening market trade based on previous day Monday bar .. which is correct... but then applies the same trade on Wednesday... marking the execution the same and applying the same stops/targets as it did on Tuesday. This error happens occasionally, and I have employed the following code to counter it... which is not solving the problem. Any ideas on what string could make sure that the Previous day OHLC is the correct one at all times? I run the latest NT8. Regards
&& Time[0].Date == DateTime.Today
Tags: None
-
Yes it sometimes works - but ZB has consistently repeated the previous days trade despite orders being cancelled via an unmanaged approach.
if (Positions[0].MarketPosition == MarketPosition.Flat
&& Time[0].Date == DateTime.Today
&& Bars.PercentComplete > 0.0001
&& PriorDayOHLC(Opens[0]).PriorOpen[0] < PriorDayOHLC(Closes[0]).PriorClose[0]
&& CurrentDayOHL(Opens[0]).CurrentOpen[0] < PriorDayOHLC(Closes[0]).PriorOpen[0]
&& State != State.Historical
&& USShorts == true)
&& Time[0].Date.Day != HolidayUS
&& Bars.TickCount <100)
{
EnterShort(0,5, "ZB Short");
}
Comment
-
Hello elliot5,
Thank you for your reply.
I don't see anything incorrect there. Would you be able to supply a stripped down version of your strategy for testing? If you are uncomfortable posting it to the forums, you can send it via email to platformsupport [at] ninjatrader [dot] com. If you do so, please include 2414371 Attn Kate W. in the subject line and a link to this post in the body. You may omit any code unnecessary for recreating the behavior.
Thanks in advance; I look forward to assisting you further.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CaptainJack, 05-29-2026, 05:09 AM
|
0 responses
474 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 05:09 AM
|
||
|
Started by CaptainJack, 05-29-2026, 12:02 AM
|
0 responses
315 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 12:02 AM
|
||
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
253 views
1 like
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
340 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
305 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|

Comment