def AddOrder(self, order): Singleton.Debug(f"Portfolio.AddOrder: {order}") Singleton.Log(f"Order size: {order.Quantity}") Singleton.Log( f"isclose({order.Quantity}, 0, abs_tol={Singleton.Securities[order.Symbol].SymbolProperties.LotSize})" ) if isclose(order.Quantity, 0, abs_tol=Singleton.Securities[ order.Symbol].SymbolProperties.LotSize): Singleton.Log( "Warning: Avoiding submitting order that has zero quantity.") return Singleton.Debug(f"AddOrder: {order}") self.__orders.append(order)
def Log(self, message): Singleton.Log("[%s] %s" % (self.Name, message))