Backtest Starter Kit: Test a Trading Rule on Real Data in Python
Test a trading rule on real market data in a few minutes.
The Backtest Starter Kit is a ready-to-run Python script. It downloads historical candles from a public exchange (or reads your own CSV file), runs a moving-average crossover backtest and saves a clear set of results.
WHAT'S INSIDE
- backtest.py: the script, commented and easy to edit
- README.md: install and usage guide
- requirements.txt
- example_output: a real sample run (report, trades, metrics)
YOU GET
Total return vs buy & hold, max drawdown, Sharpe ratio, win rate, profit factor, number of trades, a one-image report, an equity curve chart and trades.csv.
HOW IT WORKS
Real candles via CCXT, fees included (adjustable), signals act on the next candle (no look-ahead bias). Change the symbol, timeframe and moving-average windows from the command line, or replace the rule with your own.
REQUIREMENTS
Python 3.9 or newer.
IMPORTANT
Educational tool. Not financial advice, not a trading signal and not a strategy to follow. Past results do not predict future performance. The script never places orders.