PacktPublishing / Learn-Algorithmic-Trading

Learn Algorithmic Trading, Published by Packt
MIT License
802 stars 302 forks source link

chapter 7 LiquidityProvider.py bug #9

Open JosefNatanael opened 2 years ago

JosefNatanael commented 2 years ago

I think I found some bug in Chapter 7: LiquidityProvider.py

def lookup_orders(self, id) (line 11) returns a tuple of (None, None) or (o, count).

But generate_random_order(self) lines 35-40 compares the tuple with a None, making new_order always False

And line 52, shouldn't it be if new_order instead of if not new_order? If it is a new_order, we want to increase the order_id and append the new order ord to self.orders