I am developing a strategy but i have some issues. I am using the manage approach to send limit orders (target) and stop order (Stoploss). When the entry order for 5 contracts is executed, in the strategy, I send 2 limit orders for the target 1 and 2 (see picture 1 and 2) and stoploss. The problem is that when the price reach the target 1, inmediadly, the target 2 and stoploss are cancelled (see picture 3).
This problems occurs when the entry order has slippage, as you can see in the image, this example has slippage.
I used TraceOrders and the results in Ninjatrader output are:
to the orders:
29/01/2018 2:21:08 p. m. Strategy ‘Test Strategy/141663278’: Entered internal SubmitOrderManaged() method at 29/01/2018 2:21:08 p. m.: BarsInProgress=4 Action=BuyToCover OrderType=Limit Quantity=2 LimitPrice=2862.75 StopPrice=0 SignalName='Target 0 - Minute 7' FromEntrySignal='Short Entry Minute 7'
29/01/2018 2:21:08 p. m. Strategy ‘Test Strategy/141663278’: Entered internal
SubmitOrderManaged() method at 29/01/2018 2:21:08 p. m.: BarsInProgress=4 Action=BuyToCover OrderType=Limit Quantity=2 LimitPrice=2862.00 StopPrice=0 SignalName='Target 1 - Minute 7' FromEntrySignal='Short Entry Minute 7'
29/01/2018 2:21:08 p. m. Strategy ‘Test Strategy/141663278’: Entered internal
SubmitOrderManaged() method at 29/01/2018 2:21:08 p. m.: BarsInProgress=4 Action=BuyToCover OrderType=StopMarket Quantity=5 LimitPrice=0 StopPrice=2866.00 SignalName='Stoploss Minute 7' FromEntrySignal='Short Entry Minute 7'
And this the code that is generated when the orders are cancelled:
29/01/2018 2:27:44 p. m. Strategy ‘141663278/Test Strategy: Cancelled pending exit order, since associated position is closed, orderId='384926a31216458597aac6850408ab30' account='Playback101' name='Stoploss Minute 7' orderState=Accepted instrument='ES 09-18' orderAction=BuyToCover orderType='Stop Market' limitPrice=0 stopPrice=2864 quantity=3 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=1803 time='2018-01-29 14:21:08' gtd='2099-12-01' statementDate='2018-01-29'
29/01/2018 2:27:44 p. m. Strategy ‘141663278/Test Strategy: Cancelled pending exit order, since associated position is closed, orderId='14a4b2cb39974b77ae988a186afa9ddf' account='Playback101' name='Target 1 - Minute 7' orderState=Working instrument='ES 09-18' orderAction=BuyToCover orderType='Limit' limitPrice=2862 stopPrice=0 quantity=2 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=1802 time='2018-01-29 14:21:08' gtd='2099-12-01' statementDate='2018-01-29'
Can you help me to solve this issue?
Richard Martinez M.
Comment