Performance Analysis¶
Deep dive into backtest performance metrics and visualizations.
📋 Notebook Information
- RustyBT Version: 0.1.2+
- Last Validated: 2025-11-07
- API Compatibility: Verified ✅
- Documentation: API Reference
In [1]:
Copied!
from rustybt.analytics import setup_notebook
setup_notebook()
from rustybt.analytics import setup_notebook
setup_notebook()
✅ Notebook environment configured successfully - Async/await support enabled - Pandas display options optimized - Progress bars configured
Visualizations¶
All visualizations support:
- Interactive hover tooltips
- Zoom and pan
- Light/dark themes
- Export to HTML/PNG
In [2]:
Copied!
# Example: Visualize backtest results
# After running a backtest with run_algorithm(), you can visualize the results
from rustybt.analytics import (
plot_equity_curve,
plot_returns_distribution,
plot_rolling_metrics,
plot_drawdown,
)
# Assuming you have 'results' from a backtest:
# results = run_algorithm(...)
# Interactive equity curve with drawdown overlay
# fig = plot_equity_curve(results, show_drawdown=True, theme='dark')
# fig.show()
# Returns distribution with statistics
# fig = plot_returns_distribution(results)
# fig.show()
# Rolling Sharpe and volatility (60-day window)
# fig = plot_rolling_metrics(results, window=60)
# fig.show()
# Drawdown analysis
# fig = plot_drawdown(results)
# fig.show()
# Export visualizations
# fig.write_html('equity_curve.html')
# fig.write_image('equity_curve.png', width=1200, height=800)
# Example: Visualize backtest results
# After running a backtest with run_algorithm(), you can visualize the results
from rustybt.analytics import (
plot_equity_curve,
plot_returns_distribution,
plot_rolling_metrics,
plot_drawdown,
)
# Assuming you have 'results' from a backtest:
# results = run_algorithm(...)
# Interactive equity curve with drawdown overlay
# fig = plot_equity_curve(results, show_drawdown=True, theme='dark')
# fig.show()
# Returns distribution with statistics
# fig = plot_returns_distribution(results)
# fig.show()
# Rolling Sharpe and volatility (60-day window)
# fig = plot_rolling_metrics(results, window=60)
# fig.show()
# Drawdown analysis
# fig = plot_drawdown(results)
# fig.show()
# Export visualizations
# fig.write_html('equity_curve.html')
# fig.write_image('equity_curve.png', width=1200, height=800)