Multiple Order
-
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 innotify_order()
or innext()
. 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?
Thanks. -
Please post the code what you have tried so far.. Its very hard to suggest anything without that.
-
@jdrizz said in Multiple Order:
I'm not quite sure how to tell if it is executed or not
The
Order
class has astatus
property that could be used to detect the order current state:https://www.backtrader.com/docu/order/#order-status-values
Take a look at the code sample in the documentation for how it about to be used inside the
notify_order
method:https://www.backtrader.com/docu/order-creation-execution/order-creation-execution/#the-full-code