I'm new to backtrader and I've been trying to figure something out. I want to always have a set number of limit orders open.
When an order is created, I want to add it to a list. When it is executed, I want to remove it from the list and create another order.
It's not clear if this is something that needs to be implemented in
next(). From following the tutorial and some of the code examples on the site, it looks like notify_order is getting passed an Order object, but I'm not quite sure how to tell if it is executed or not.
How would you implement this in backtrader?
Please post the code what you have tried so far.. Its very hard to suggest anything without that.
vladisld last edited by
I'm not quite sure how to tell if it is executed or not
Orderclass has a
statusproperty that could be used to detect the order current state:
Take a look at the code sample in the documentation for how it about to be used inside the