In the onbarupdate event, if the marketposition is flat, I submit a limit order to sell above the market and a buy limit below the market. The levels change on each bar. If there is an existing by and sell limit (i.e the order is not null), I cancel the existing order and resubmit the order. Sometimes the orders just get cancelled. This also is true when I enter a stoploss using the OnExecution even handler. Sometimes the stops don't get entered and I am sitting there with an exposed position
1. What I see happening is that sometimes the order is just cancelled in real time and a new order is not submitted. What I see in the output window (I have trace orders enabled) is that the cancel is pending. Should I be using the change order method rather than just cancelling and resubmitting on each bar?
2. Should I be using a different event to change or cancel and replace the orders?
3. Is this a problem with TopStepTrader's simulation engine in that cancels are not confirmed and I need to find another way to handle changing the order?
4. Could I accomplish the same type of strategy by using managed orders in that one strategy would be for a long only ATS and the other for short only ATS and run the 2 strategies at the same time?
Thank you,
Cowpux
Comment