1. Enter the market using a stop market entry (eg place a long stop market above current price and wait for it to trigger).
2. There is a spike up and the entry triggers long
3. The strategy then sets a stoploss and profit target as OCO orders. These are submitted at the same time.
3. The market moves fast so the profit target is hit.
4. The stoploss is rejected because "it is not in a state where it can be used in an OCO". So, the strategy shuts down and closes all orders.
The problem is this: suppose I have 3 such entries with different profit targets (say 8 ticks, 15 ticks and 30 ticks), As soon as target 1 is hit, stoploss 1 order is rejected for the above reason and my strategy then closes all positions and orders. So I miss out on targets 2 and 3 because the strategy has shut down.
Is there any way to detect a stoploss that is rejected because its corresponding target has been filled, and simply ignore that stop? Is there any danger I am not seeing to doing so?
Comment