Skip to main content

Backtest visualization widget for JupyterLab

Project description

📈 Backtest Visualization Tool — bt-visualizer

A lightweight, interactive charting tool to visualize your backtest results inside JupyterLab, with trade annotations, zoom support, tooltips, and more.

https://github.com/user-attachments/assets/df64633e-7e28-4a82-b4da-9640e7d01b62


✨ Features

  • 🕵️ 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

📦 Installation

You can install the Python package via pip:

pip install bt-visualizer

Make sure you have JupyterLab installed as well.

🛠️ Usage Example

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"
)

📂 Input Data Format

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

🌐 Online Demo

You can also try the standalone version of the app, deployed here:

👉 Deployed App

💻 Developer Setup (Optional)

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.

📝 License

MIT License.

Created by Ali Gheshlaghi.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bt_visualizer-0.2.3.tar.gz (128.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bt_visualizer-0.2.3-py3-none-any.whl (130.5 kB view details)

Uploaded Python 3

File details

Details for the file bt_visualizer-0.2.3.tar.gz.

File metadata

  • Download URL: bt_visualizer-0.2.3.tar.gz
  • Upload date:
  • Size: 128.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for bt_visualizer-0.2.3.tar.gz
Algorithm Hash digest
SHA256 d0e505975fedd3a9798a969c09541e3917e2cd44c5a512d18c14ab49f9b1a708
MD5 8d152d0a5d5f09dd33ce55fb34913bd7
BLAKE2b-256 b151576a86b803b763436321e3fcc439b6a4418f1a151703bc7af8e71b253f09

See more details on using hashes here.

File details

Details for the file bt_visualizer-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: bt_visualizer-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 130.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for bt_visualizer-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8cd2ceddd3f02ae7903451595fcc2446acfa5d7dc34fe65877be3dae03b0eec4
MD5 5beaaf2f3d1a69856b2604a48855a3b4
BLAKE2b-256 f13c2eadd97331e1c597cb8c85b080657553e0c257689f8ddd9ab821ab160980

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page