Moving Average And VWAP Trend Strategies Backtest In Python
Loses money
No edge after realistic trading costs
- trades tested
- 5,152
- per trade after costs
- -7.69bp
- winners
- 29%
- years of data
- 4.8
BTCUSD 15m trend-pullback bot: when the last 7 candles (current + 6 back candles) are entirely above the daily VWAP and the current candle's low comes within $100 of the VWAP, buy (mirror for shorts below). Stop 0.8 x ATR(5) from the close, take profit 2.5 x the stop distance, one trade at a time; the same rules are also run on a 100 EMA instead of the VWAP.
The exact rules we tested
- 01Instrument: BTCUSDT | Signal timeframe: 15m | Direction: both
- 02LONG when: ([low > vwap] on each of the last 7 bars) AND (dlv <= 100)
- 03SHORT when: ([high < vwap] on each of the last 7 bars) AND (dhv <= 100)
- 04Entry: market at next bar open
- 05Stop: 0.8 x ATR(5)
- 06Target: 2.5R (risk-multiple of stop)
- 07Where dlv = low minus vwap
- 08Where dhv = vwap minus high
- 09Where dle = low minus ema100
- 10Where dhe = ema100 minus high