&& 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 Mindset, 04-21-2026, 06:46 AM
|
0 responses
87 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
132 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
65 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
118 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
67 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment