コード例 #1
0
 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)
コード例 #2
0
 def Log(self, message):
     Singleton.Log("[%s] %s" % (self.Name, message))