investfly.models.portfolio.Portfolio
Portfolio state exposed to SDK clients and strategy callbacks.
class
Portfolio:
Current balances, positions, pending orders, and completed trades.
Attributes:
- portfolioId: Stable Investfly identifier for the portfolio.
- broker: Broker connected to the portfolio.
- balances: Current account balances.
- openPositions: Positions currently held by the portfolio.
- pendingOrders: Orders that have not reached a terminal state.
- completedTrades: Filled trades recorded for the portfolio.
def
findPosition( self, security: investfly.models.marketdata.Security, positionType: investfly.models.portfolio.PositionType) -> investfly.models.portfolio.OpenPosition | None:
Return the matching open position, or None when it is not held.