Open position but no resting order
Andre Frade last edited by
I am new to backtrader and I have been stuck on a problem for a while.
In my strategy, I am placing buy and sell orders simultaneously. At each cycle, my function next is designed to first check whether a position is open or closed. If open, I would like to look at details of the order that is still resting.
I thought that if a position is open, it is because one of my orders was executed and the other one is still to be. However, my code breaks because although it finds an open position, it does not find any resting order.
Any ideas of what might be going on ? Perhaps this has to do with my little understanding of the process, but I could not yet find a good walk through.
Thank you very much in advance.