How erfaniaa/crypto-trading-strategy-backtester works
This is a configurable cryptocurrency strategy backtester. The user runs main.py, which initializes the backtester from config.py; it obtains candle history, iterates market data to open and close long/short positions, then produces statistical reports, plots, position exports, and train/test datasets. The README also documents cached data for offline reuse and interactive position charts. The sampled excerpts show the main execution and several output calls; other connections rely on the SOURCE INDEX or README, so uncertain links are omitted.
Main entry points: backtester.py Backtest engine · main.py Run entry point · binance_api.py Binance candle API · plot_maker.py Plots and charts
Components 17
Run and configuration
- Run entry point
main.py - Strategy settings
config.py
Market data
- Binance candle API
binance_api.py - Candle model
candle.py - Timeframe utilities
utils.py - Offline candle cache
backtester.py
Backtest simulation
- Backtest engine
backtester.py - Indicator calculations
indicators.py - Position model
position.py - Position result data
position_result_and_candles.py
Analysis and outputs
- Candle statistics
backtester.py - Reports and exports
report_maker.py - Research datasets
backtester.py - Plots and charts
plot_maker.py
Other components
- User
- Binance
- Interactive chart library
Connections 18
- User → Run entry point: runs
README.md - Run entry point → Strategy settings: reads settings
main.py - Run entry point → Backtest engine: starts backtest
main.py - Backtest engine → Strategy settings: uses settings
backtester.py - Backtest engine → Binance candle API: requests candles
backtester.py - Binance candle API → Binance: fetches history
binance_api.py - Binance candle API → Candle model: creates candles
binance_api.py - Backtest engine → Candle model: processes candles
backtester.py - Backtest engine → Timeframe utilities: uses timeframes
backtester.py - Backtest engine → Indicator calculations: calculates indicators
backtester.py - Backtest engine → Position model: opens positions
backtester.py - Backtest engine → Position result data: builds result data
backtester.py - Backtest engine → Candle statistics: collects statistics
backtester.py - Backtest engine → Reports and exports: generates reports
backtester.py - Backtest engine → Research datasets: generates datasets
README.md - Backtest engine → Plots and charts: renders plots
backtester.py - Plots and charts → Interactive chart library: supports charting
README.md - Backtest engine → Offline candle cache: reuses saved data
README.md