A lightweight, interactive charting tool to visualize your backtest results inside JupyterLab, with trade annotations, zoom support, tooltips, and more.
bt-visualizer.mp4
- 🕵️ Hover to see trade information
- 🖱️ Click to zoom into a specific trade
- 🔍 Zoom / pan support
- 🖱️ Double click to zoom out
- 🔄 Reset chart and load new backtest results dynamically
You can install the Python package via pip:
pip install bt-visualizer
Make sure you have JupyterLab installed as well.
Inside your JupyterLab notebook:
from bt_visualizer import show_bt_visualization
# Ensure the following files are present in the project directory
show_bt_visualization(
equity="equity_curve.csv",
stats="stats.csv",
ohlc="ohlc.csv",
trades="trades.csv"
)
The visualization expects CSV input following the structure from backtesting.py outputs.
You can find sample input files here to see the expected format.
Files expected:
-
equity_curve.csv
-
stats.csv
-
ohlc.csv
-
trades.csv
You can also try the standalone version of the app, deployed here:
If you want to run or modify the TypeScript frontend locally:
git clone https://github.com/Finance-Insight-Lab/bt-visualizer.git
cd bt-visualizer
npm install
npm run dev
This will start the development server.
MIT License.
Created by Ali Gheshlaghi.