Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Using EnterLongStop and EnterShortStop
Collapse
X
-
Using EnterLongStop and EnterShortStop
I have a simple breakout strategy that uses EnterLongStop and EnterShortStop, but they are not working as I was expecting. When I am short in the market and give an EnterLongStop() that does hit my stop price on the next bar, I was expecting that the short position would be closed and a new long position would be created. Is that correct? Right now it would seem that the EnterLongStop() is ignored and only fires off when the strategy is flat with no position.Tags: None
-
Hello,
This may be due to one of the conditions leading up to the EnterLongStop, It is hard to say with little details. The expected action would be a reversal if you submit the opposite direction Entry order and it gets filled.
Here is a simple example that would show reversals using Stop orders:
You may try using the Output Window to see if any Ignore order messages are in there, also TraceOrders is very helpful for tracking down order issues.Code:protected override void OnBarUpdate() { if (Position.MarketPosition == MarketPosition.Long) { EnterShortStop(Close[0] - 2 * TickSize); } if (Position.MarketPosition == MarketPosition.Short) { EnterLongStop(Close[0] + 2 * TickSize); } if (Position.MarketPosition == MarketPosition.Flat) { EnterLongStop(Close[0] + 2 * TickSize); } }
I look forward to being of further assistance.
-
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
630 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
364 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 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
566 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
568 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment