PortfolioSnapshot#
tradingstrategy.analysis.portfolioanalyzer.PortfolioSnapshot Python class in Trading Strategy framework.
- class PortfolioSnapshot[source]#
Bases:
object
Represents the portfolio status at the start of the day/candle snapshot
- __init__(tick, cash_balances, asset_snapshots, state_details=None)#
Methods
__init__
(tick, cash_balances, asset_snapshots)Return asset snapshots in an order where the heaviest asset is first.
Return asset snapshots in a stable order between days.
Attributes
Internal state dump of the algorithm when this trade was made.
A running counter where the first backtest simulated event is tick 1, the next one tick 2
What reserve currencies we have.
What reserve currencies we have.
- tick: int#
A running counter where the first backtest simulated event is tick 1, the next one tick 2
- cash_balances: Dict[str, float]#
What reserve currencies we have. E.g. USD: 10_000 Resever currenecies expressed as strings for the backwards compatibiltiy.
- asset_snapshots: Dict[int, AssetSnapshot]#
What reserve currencies we have. E.g. USD: 10_000 Resever currenecies expressed as strings for the backwards compatibiltiy.
- state_details: Optional[Dict] = None#
Internal state dump of the algorithm when this trade was made. This is mostly useful when doing the trade analysis try to understand why some trades were made. It also allows you to reconstruct the portfolio state over the time.
- get_ordered_assets_stable()[source]#
Return asset snapshots in a stable order between days.
- Return type: