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 charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
60 views
0 likes
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
145 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
161 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
97 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
283 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|

Comment