While you can use methods at the price, such as EnterLong and EnterShort to reverse, what you are attempting to do violates the IOH (Internal Order Handling) Rules.
and implement an OnOrderUpdate handler which cancels existing short orders. You can use the OrderAction to tell them apart.
Given all of this, I would recommend entering the market with regular Market orders using EnterLong and EnterShort, especially if you are a beginning programmer.
Please let us know if there are any other ways we can help.

Leave a comment: