I am currently live trading an algorithm and it keeps going into negative cash despite having a leverage of 1. I am assuming this is because I buy and sell my positions randomly, should I first sell my old positions and then buy the new stocks? I am not sure if this would solve the issue unless the order function waits until a order is filled before moving on to the next order, but it doesn't. Anyone know how I can enforce this behavior?