&& 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 NullPointStrategies, Today, 05:17 AM
|
0 responses
52 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
130 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
70 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
44 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
48 views
0 likes
|
Last Post
|

Comment