Skip to content

PointInTimePortfolio

QuantConnect.Report.PointInTimePortfolio

PointInTimePortfolio(
    order: Order, portfolio: SecurityPortfolioManager
)
PointInTimePortfolio(
    portfolio: PointInTimePortfolio,
    time: Union[datetime, date],
)

Bases: Object

Lightweight portfolio at a point in time

Signature descriptions:

  • Creates an instance of the PointInTimePortfolio object

  • Clones the provided portfolio

Parameters:

Name Type Description Default
order Optional[Order]

Order applied to the portfolio

None
portfolio SecurityPortfolioManager | PointInTimePortfolio

Algorithm portfolio at a point in time

required
time Optional[Union[datetime, date]]

Time

None

time

time: datetime

Time that this point in time portfolio is for

total_portfolio_value

total_portfolio_value: float

The total value of the portfolio. This is cash + absolute value of holdings

cash

cash: float

The cash the portfolio has

order

order: Order

The order we just processed

holdings

holdings: List[PointInTimeHolding]

A list of holdings at the current moment in time

leverage

leverage: float

Portfolio leverage - provided for convenience

PointInTimeHolding

PointInTimeHolding(
    symbol: Union[Symbol, str, BaseContract],
    holdings_value: float,
    holdings_quantity: float,
)

Bases: Object

Holding of an asset at a point in time

Creates an instance of PointInTimeHolding, representing a holding at a given point in time

Parameters:

Name Type Description Default
symbol Union[Symbol, str, BaseContract]

Symbol of the holding

required
holdings_value float

Value of the holding

required
holdings_quantity float

Quantity of the holding

required

symbol

symbol: Symbol

Symbol of the holding

holdings_value

holdings_value: float

Value of the holdings of the asset. Can be negative if shorting an asset

quantity

quantity: float

Quantity of the asset. Can be negative if shorting an asset

absolute_holdings_value

absolute_holdings_value: float

Absolute value of the holdings.

absolute_holdings_quantity

absolute_holdings_quantity: float

Absolute value of the quantity

no_empty_holdings

no_empty_holdings() -> PointInTimePortfolio

Filters out any empty holdings from the current holdings

Returns:

Type Description
PointInTimePortfolio

Current object, but without empty holdings.