I recently had two positions open of 0.2M short in my programmed strategy. Then the strategy triggered the buy to cover (exit short) order for both of those 0.2M shorts when it was supposed to do so, and it opened a single 0.2M buy order which happened to be at the same point of the exit short order which it was supposed to.
The problem is that the strategy also did a close position on the two open short positions in addition to the buy to cover. So instead of now being 0.2M long due to the single buy order, I am now 0.6 long because of the extraneous close position (or is it the buy to cover that was extraneous).
But now even more confusing is that the position window is showing only 0.4 long even while the strategy window is showing the 0.6 long.
Either way, it should really only be 0.2 long because it shouldn't have "close position" after it already "buy to cover" (see attachment).
Please help me figure out how to stop my program from both buying to cover and closing position before it opens another position in the opposite direction.
Thanks.
Comment