portfolio_toolkit.position.open.list_from_portfolio module

portfolio_toolkit.position.open.list_from_portfolio.get_open_positions(assets: List[PortfolioAsset], date: str) OpenPositionList[source]

Gets the open positions of a portfolio as of a given date and returns them as an OpenPositionList.

Parameters:
  • assets (List[PortfolioAsset]) – List of PortfolioAsset objects containing transactions.

  • date (str) – The date up to which the positions are calculated (YYYY-MM-DD).

Returns:

A list-like object representing open positions.

Return type:

OpenPositionList

portfolio_toolkit.position.open.list_from_portfolio.get_asset_open_positions(asset: PortfolioAsset, date: str) OpenPosition[source]

Computes the open position of an asset as of a given date.

Parameters:
  • asset (PortfolioAsset) – The asset containing transactions.

  • date (str) – The date up to which the position is calculated (YYYY-MM-DD).

Returns:

An object representing the open position with valuation.

Return type:

ValuedPosition