I have implemented a Strategy that use ATM strategy to manage the order.
I have used the code of the sample provided with the platform.
It works fine except when market is fast and the OCO order are rejected.
this is an error message of that situation:
2021-12-10 14:30:03:821|1|32|Order='b32dcc5c81de44309ab98a6e6 ba539ec/Simstrategy3' Name='Stop1' New state='Rejected' Instrument='MNQ 12-21' Action='Buy to cover' Limit price=0 Stop price=16163.75 Quantity=1 Type='Stop Market' Time in force=GTC Oco='9530e85147ef4be7897fea8ed74221e2' Filled=0 Fill price=0 Error='Order rejected' Native error='Buy stop or buy stop limit orders can't be placed below the market.'
2021-12-10 14:30:03:823|0|32|Simstrategy3, Buy stop or buy stop limit orders can't be placed below the market. affected Order: BuyToCover 1 StopMarket @ 16163,75
2021-12-10 14:30:03:830|1|32|Order='ded9aa708144498ea4ebaeb23 a410072/Simstrategy3' Name='Target1' New state='Rejected' Instrument='MNQ 12-21' Action='Buy to cover' Limit price=16137.25 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='9530e85147ef4be7897fea8ed74221e2' Filled=0 Fill price=0 Error='Unable to submit order' Native error='Order 'ded9aa708144498ea4ebaeb23a410072' can't be submitted: The OCO ID ‘9530e85147ef4be7897fea8ed74221e2’ cannot be reused. Please use a new OCO ID.'
2021-12-10 14:30:03:830|0|32|Simstrategy3, Order 'ded9aa708144498ea4ebaeb23a410072' can't be submitted: The OCO ID ‘9530e85147ef4be7897fea8ed74221e2’ cannot be reused. Please use a new OCO ID. affected Order: BuyToCover 1 Limit @ 16137,25
I would like to deal this with command : "AtmStrategyClose(string atmStrategyId)"
but at this point I don't have idea how to trigger the error and then apply the command above.
Could you send me an example of coding?...
I'm suggesting you to also add it to the sample code
Thanks
Roberto
Comment