How to Backtest a Trading Strategy in Python
How to backtest a trading strategy in under 80 lines of plain Python: a 5/20 moving average crossover with next-open fills, fees, slippage and a split fix.
Filtering by topic #backtesting · clear
How to backtest a trading strategy in under 80 lines of plain Python: a 5/20 moving average crossover with next-open fills, fees, slippage and a split fix.
Backtesting replays a trading rule over past bars, seeing only what was known at the time. What comes out, four ways it lies, and when a result is too good.