&& Time[0].Date == DateTime.Today
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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
-
Hello elliot5,
Thank you for your post.
Would you be able to post a sample of the current entry conditions you have in your for the trade?
And if I'm understanding correctly, it sometimes does work as you intended, is that correct?
Thanks in advance; I look forward to assisting you further.Kate W.NinjaTrader Customer Service
-
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.Kate W.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by wzgy0920, Yesterday, 09:53 PM
|
2 responses
49 views
0 likes
|
Last Post
by wzgy0920
Today, 10:29 PM
|
||
Started by Kensonprib, 04-28-2021, 10:11 AM
|
5 responses
191 views
0 likes
|
Last Post
by Hasadafa
Today, 10:19 PM
|
||
Started by GussJ, 03-04-2020, 03:11 PM
|
11 responses
3,230 views
0 likes
|
Last Post Today, 08:07 PM | ||
Started by andrewtrades, Today, 04:57 PM
|
1 response
14 views
0 likes
|
Last Post Today, 05:02 PM | ||
Started by chbruno, Today, 04:10 PM
|
0 responses
7 views
0 likes
|
Last Post
by chbruno
Today, 04:10 PM
|
Comment