Simple utilities for:
- Batch importing candle data into your Jesse database
- Running parallel backtests to find the best symbols and timeframes for a strategy and period
batch_importer.py: Imports historical candles for a list of symbols and repeats daily. Handles rate limits and temporary network issues with retries.batch-backtest.py: Runs many backtests in parallel (via Ray) across symbols and timeframes, then prints a sorted summary and plots to compare performance.
- Python 3 with your Jesse environment available
- Jesse Framework (used via
jesse.researchandjesse.enums) - For backtesting visuals/parallelism:
pandas,matplotlib,seaborn,tqdm,ray - Place these scripts inside your Jesse project and run them from that directory
- Ensure the conda environment with Jesse is installed and activated
Install extras into the same environment that has Jesse installed, for example:
pip install pandas matplotlib seaborn tqdm rayWatch a quick demo: Parallel backtesting and importer overview
- Open
batch_importer.pyand adjust configuration at the top:EXCHANGE: exchange enum (e.g.,exchanges.BINANCE_PERPETUAL_FUTURES)SYMBOLS: list of symbols to keep up to dateSTART_DATE: earliest date to import (YYYY-MM-DD)
- Run:
python batch_importer.pyThe script loops through all symbols, retries on rate limits/network issues, and then sleeps for 24 hours.
- Open
batch-backtest.pyand adjust configuration at the top:STRATEGY_NAMEEXCHANGE_NAMESYMBOLS,TIMEFRAMESSTART_DATE,END_DATE- Optional data routes in
DATA_ROUTES(for higher-timeframe/context data) CONFIG(starting balance, fees, leverage,warm_up_candles, etc.)
- Run:
python batch-backtest.pyThe script:
- Initializes Ray and uses ~80% of available CPU cores (falls back to sequential if Ray init fails)
- Executes all symbol/timeframe combinations
- Prints a summary table sorted by Sharpe Ratio and shows comparison plots (heatmaps and bar charts)
- Ensure candle data for desired symbols/timeframes exists locally; use
batch_importer.pybeforehand if needed. - Equity curve and file outputs are disabled in the backtester to keep runs fast and clean.