I have a problem with an automatic trading strategy.
Everything actually works up to the point where a position is flipped. The order is first not accepted, then it is often executed twice.
so a long position is closed (sell), sell order is set but not executed, then the order is executed twice and the strategy does not work anymore because the position size is not correct.
I have attached a screenshot of the log and 2 examples of a correct, normal execution and a wrong execution. Normally only one order would be opened in one direction, but on the picture you can see how 2 orders were opened.
Comment