Say I have 0 cash in my account, and I would like to buy A stock for 100 and sell B stock for 100 at the next bar. Only the sell order will be executed, and the buy order status will be 'Margin' and I will end up with 100 cash sitting in my account at the end of the next bar.
I have to create additional bars to get both the sell and buy orders executed.
Is there any other way to solve this?
Thank you.