here is the situation.
I have opened positon. Then at one moment in OnBarUpdate i decide to change the position to opposite. I close my position with ExitLong or ExitShort and immediately send EnterShortLimit or EnterLongLimit, and then receive usual "An Enter() method to submit an entry order at '11/05/2017 03:48:54' has been ignored. Please search on the term 'Internal Order Handling Rules' in the Help Guide for detailed explanation."
The log:
Historical 11/05/2017 03:48:54 We're are in long position right now. Exiting it... Historical 11/05/2017 03:48:54 Order updated: Type=Market; Action=Sell; Name=Exit long; Qty=1; CurrentState=Submitted; Historical 11/05/2017 03:48:54 Order updated: Type=Market; Action=Sell; Name=Exit long; Qty=1; CurrentState=Accepted; Historical 11/05/2017 03:48:54 Order updated: Type=Market; Action=Sell; Name=Exit long; Qty=1; CurrentState=Working; Historical 11/05/2017 03:48:54 Attention: Entry signal occured: Enter short: Historical 11/05/2017 03:48:54 Opening short limit at price 47.4... Strategy 'Adam Trading Strategy/-1': An Enter() method to submit an entry order at '11/05/2017 03:48:54' has been ignored. Please search on the term 'Internal Order Handling Rules' in the Help Guide for detailed explanation. Historical 11/05/2017 03:48:54 Order updated: Type=Market; Action=Sell; Name=Exit long; Qty=1; CurrentState=Filled; FillPrice=47.45; Historical 11/05/2017 03:48:54 Filling executed. Current price info:Current Ask=47.45, Bid=47.45, Bar Index=22, Bar TOHLC=[11/05/2017 03:48:54;47.45;47.47;47.44;47.45], Bar Ticks=1, Position=[Flat] Historical 11/05/2017 03:48:54 Position updated: instrument='CL 06-17' account='Backtest' avgPrice=0 quantity=0 marketPosition=Flat statementDate='1800-01-01'
Is there any mechanism to wait exiting position filled not leaving OnBarUpdate?
Comment