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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
81 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
42 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
64 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
66 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
54 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment