I'm running an automated strategy that is occasionally creating a situation where there are a take-profit and stop-loss order bracket pair submitted to the market, but there's no open position to go along with it -
The strategy has an entry trigger for longs which buys one contract with a fixed take-profit and stop-loss as an OCO pair; the strategy also has an entry trigger for shorts, which sometimes triggers while a long trade is still open, before hitting either TP or SL - this usually seems to close the open long and initiates a new short with its own TP and SL bracket order - but is it possible there's something happening where the new short position is not being opened, but only closing the long that's currently open? Because in this case, when a new short trigger comes, then the strategy goes short for two contracts, which is not what's intended.
Is there a way to ensure that when a new short is triggered, that any open longs are closed and a new short is opened? (same vice versa when going from short to long) - this is my first time running an automated strategy, so I wonder if there's something basic I'm missing -
Thanks very much -
P.S. This is the logic in the strategy builder for trade management -

Comment