Get list of orders?
I've recently run across Backtrader. It is an impressive piece of software, but I think the learning curve is a bit steep (at least for me!) ;-(
My question: I don't want to enter an order if I already entered one in the previous one or two days. So, I just want to check whether an order was entered. Something like this pseudo-code:
if not order[-2] and not order[-1]: order.buy()
How would I do that?
run-out last edited by
Whenever you create a new order, track the length of self (current index) in a variable.
So in your strategy:
def __init__(self): self.track_last_order = 0 def next(self): if (len(self) - self.track_last_order) > 2: # you make a new order here... then self.track_last_order = len(self)
@run-out Thank you!