Portfolio
init_stats seeds the history lists and must run before the first pulse, which marks the
open trades, queues their fee events, closes what is due and nets the pulse’s fees against
equity. The portfolio keeps no greek aggregate: book exposure is the sum of
Trade.delta_contract over open_trades, computed where it is needed.
Parameters
Attributes
Portfolio.trades
property
Portfolio.open_trades
property
Portfolio.pulse_total_pnl
property
pulse_abs_pnl across all open trades for the most recent pulse.
Returns
Portfolio.pulse_total_pnl_history
property
datetimes (one entry per pulse).
Returns
Portfolio.daily_datetimes
property
Portfolio.daily_total_pnl_history
property
Portfolio.equity_history
property
Portfolio.datetimes
property
Portfolio.current_equity
property
Portfolio.initial_equity
property
Portfolio.equity_pct_change
property
Portfolio.equity_pct_change_history
property
Portfolio.pulse_fees
property
pulse() used to zero the
accumulator on its way out, so this could only ever answer 0.0 however much was charged.
Portfolio.pulse_fees_history
property
datetimes (one entry per pulse).
Portfolio.total_fees
property
init_stats.
Portfolio.init_stats
Portfolio.add_trade
Portfolio.pulse
Portfolio.close_all
Portfolio.__charge_exit_fee
trade._close_price
is guaranteed to be set by _instant_trade_close immediately prior.
The event is drained alongside entries/rebalances at end of pulse().
Portfolio.__close_trades
_close_on_pulse_end.
Parameters

