Bollinger Bands
Rolling mean with standard deviation envelopes
Distributions
Return and PnL histograms with full statistics
Heatmaps
Monthly returns and correlation matrices
Underwater
Per-point drawdown depth for area charts
Trade Scatter
Buy/sell markers with PnL attribution
PlotBundle
One-call extraction of all plot data
Quick Start
One-Call Extraction
from_backtest
Extract all plot data from a BacktestResult in a single call.
Returns a
PlotBundle containing all extracted data.
Individual Functions
bollinger_bands
Returns
BandData with timestamps, middle, upper, lower, bandwidth.
underwater_curve
UnderwaterData with per-point drawdown_pct and peak tracking.
histogram
HistogramData with bin_edges, bin_centers, counts, frequencies, plus mean, median, std, skew, kurtosis.
return_distribution
HistogramData.
pnl_distribution
HistogramData of PnL values.
monthly_returns_heatmap
HeatmapData with years as rows and months (Jan-Dec) as columns.
correlation_heatmap
HeatmapData with Pearson correlation coefficients.
rolling_stats
RollingStatData with sharpe and sortino as CurveData.
normalized_equity
NormalizedEquityData with equity normalized to 1.0 and cumulative PnL.
trade_scatter
TradeScatterData with all points, buys, and sells as TradeScatterPoint tuples.
calibration_plot
CalibrationPlotData with bin_centers, actual_freq, perfect_line, ece, and brier_score. Uses Rust calibration_curve() when available, falls back to pure Python.
Output Types
All types are frozen dataclasses with tuple fields (immutable).