investfly.utils.TradeOrderAccumulator
@dataclass
class
TraderOrderWithStrength:
TraderOrderWithStrength( tradeOrder: investfly.models.portfolio.TradeOrder, strength: int = 1)
tradeOrder: investfly.models.portfolio.TradeOrder
class
TradeOrderAccumulator:
TradeOrderAccumulator( portfolio: investfly.models.portfolio.Portfolio, percentAllocation: float)
openOrders: List[investfly.models.portfolio.TradeOrder]
openOrdersWithStrength: List[TraderOrderWithStrength]
closeOrders: List[investfly.models.portfolio.TradeOrder]
Collects an open order, along with its associated strength value, for deferred processing. Orders collected via this method will be sorted by strength and considered for order submission based on available buying power when getOrders() is called.
@staticmethod
def
calculatePercentAllocation( universe_securities: List[investfly.models.marketdata.Security], minAllocation: float = 5.0) -> float: