investfly.utils.TradeOrderAccumulator

@dataclass
class TraderOrderWithStrength:
TraderOrderWithStrength( tradeOrder: investfly.models.portfolio.TradeOrder, strength: int = 1)
strength: int = 1
class TradeOrderAccumulator:
TradeOrderAccumulator( portfolio: investfly.models.portfolio.Portfolio, percentAllocation: float)
BROKER_FEE = 1.0
portfolio
portfolioValue
allocatedAmountPerSecurity
buyingPower
openOrdersWithStrength: List[TraderOrderWithStrength]
hasMoreBuyingPower
openAndPendingSecurities
def addOrder(self, order: investfly.models.portfolio.TradeOrder) -> bool:
def collectOpenOrderWithStrength( self, ordeWithStrength: TraderOrderWithStrength) -> bool:

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.

def getOrders(self) -> List[investfly.models.portfolio.TradeOrder]:
@staticmethod
def calculatePercentAllocation( universe_securities: List[investfly.models.marketdata.Security], minAllocation: float = 5.0) -> float: