if (CrossAbove(MAseries, DWMAseries, 1))
{if (myEntryOrderL == null)
myEntryOrderL = EnterLongStop(0, true, 1, High[0] + TickSize, "L");
else if (myEntryOrderS != null)
CancelOrder(myEntryOrderS);}
else if (CrossBelow(MAseries, DWMAseries, 1))
{if (myEntryOrderS == null)
myEntryOrderS = EnterShortStop(0, true, 1, Low[0] - TickSize, "S");
else if (myEntryOrderL != null)
CancelOrder(myEntryOrderL);}
#endregion
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Problem with Stop Orders
Collapse
X
-
To be honest Brett if you could simply tell me what is wrong with the following code then that would be much quicker:
Put simply if MA's cross then it enters a stop order at 1 tick above/below high/low of signal bar, then the order needs to stay on the market until it crosses the other way. Let me know if there is any confusion.Code:
-
Hello,
I took a look however I dont see anything specifically off with these lines of code. However they would require adding in the Print statements and Trace orders to isolate what actions the strategy is taking at one times to help us narrow down what is going on.
I dont see you specifically setting the iOrder object to null, are you doing this inside of OnOrderUpdate()?
-BrettBrettNinjaTrader Product Management
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
656 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
371 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
109 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
574 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
579 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment