A strategy I'm running writes a logfile with the current position which order details such as entry price, name, entry times, side, etc. and looks like this:
5,S-REG3-5,REG3,09:27:07,Feb,7,Tuesday,9,short,75.26,0,75.9 8,75.25,837,RECEND
When the strategy starts up it if PositionAccount.MarketPosition != MarketPosition.Flat it checks the recovery file and reads these details into an order object and pushes it onto a list. I would then like it to continue monitoring price movements and exit this position at the appropriate time based on moving stops.
Note I've also tried jumping into recovery logic with Positions[tradedInstrument].MarketPosition != MarketPosition.Flat and it goes there which I understand to mean it recognizes these positions were created by the strategy to begin with.
I also have the following set:
IsAdoptAccountPositionAware = true;
StartBehavior = StartBehavior.AdoptAccountPosition;
However I get this:
Reading Trade Record...
Position recovered...
2/7/2023 10:09:01 AM Strategy 'A1Dev/302631936': Entered internal SubmitOrderManaged() method at 2/7/2023 10:09:01 AM: BarsInProgress=1 Action=BuyToCover OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='S-REG3-5-close' FromEntrySignal='S-REG3-5'
2/7/2023 10:09:01 AM Strategy 'A1Dev/302631936': Ignored SubmitOrderManaged() method at 2/7/2023 10:09:01 AM: BarsInProgress=1 Action=BuyToCover OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='S-REG3-5-close' FromEntrySignal='S-REG3-5' Reason='SignalName does not have a matching FromEntrySignal to exit'
Is there no way to read in an order signal name and all and slide back into Managed exits?
Mark
Comment