Backtesting a simple ETH moving-average strategy from OHLCV CSV data.
This project uses a lightweight Pandas-based backtest (no Zipline dependency), compatible with modern Python.
Dataset note: this repo uses historical ETH data from June 20, 2017 to June 19, 2018 (ETH-USD.csv).
- Python 3.10+
- Install dependencies:
pip install -r requirements.txtpython trading-algo.py --csv ETH-USD.csv --output result.pngUseful flags:
--no-plotto skip interactive display.--fast-windowand--slow-windowto tune MA windows.--capital-baseto change starting capital.
Generated chart:
Latest run output on this dataset:
Final strategy value: 1,935.45
Final buy/hold value: 1,498.45
Signals generated: 9
Run:
python -m unittest tests/test_smoke.pyCurrent smoke-test outcome:
.
----------------------------------------------------------------------
Ran 1 test in 1.853s
OK
