My goal is to be able to enable the same strategy again on the same symbol when the ninjatrader app gets closed by mistake, and for the system to pick up the strategy position and open orders.
Thanks to reviewing other posts on this forum I was able to get the code to the stage when the strategy position is being equalized to the account position (when the strategy is re-enabled) and the entry order is recognized together with the fill price and quantity (according to the output). HOWEVER, when the time comes for the exit order to be executed, nothing happens, despite all the conditions being met.
Specifically I noticed an error occurs that says:
7/17/2023 10:39:59 AM Strategy 'strategy/': Ignored SubmitOrderManaged() method at 7/17/2023 10:39:59 AM: BarsInProgress=0 Action=BuyToCover OrderType=Limit Quantity=160 LimitPrice=3.50 StopPrice=0 SignalName='long_1115Exit' FromEntrySignal='long_1115' Reason='SignalName does not have a matching FromEntrySignal to exit'
It is very weird since the same time the system sees the signal:
myEntryOrder_1115 name='long_1115' orderState=Filled instrument='XXXX' orderAction=SellShort orderType='Limit' limitPrice=3.15 stopPrice=0 quantity=160 tif=Gtc oco='' filled=160 averageFillPrice=3.2 onBehalfOf='' id=-1 time='2023-07-12 13:04:14' gtd='2099-12-01' statementDate='2023-07-17'
As a reference point only, when I delete the signal requirement from the exit order, it does work as expected BUT I cannot remove the signal requirement since I've got multiple entry orders with different signals and each of them has a separate exit with different conditions.
I would appreciate your further help with this since I am running out of options.
Thanks,
Wojciech

Comment