Phase 1: Event-driven backtester, 5 strategies, and baseline results

- Built event-driven backtesting engine with spread/slippage modeling,
  3-TP partial closes, trailing stops, and rich trade logging (20+ features)
- Implemented 5 strategy signal generators (MA Breakout, VWAP Reversal,
  Key Level Breakout, EMA Ribbon Scalp, Momentum Exhaustion)
- Full indicator library (EMA, SMA, RSI, ATR, MACD, ADX, Stochastic,
  Session VWAP bands, swing points, key levels, RSI divergence)
- Data pipeline: Dukascopy download, validation, 70/30 train/test split
- Baseline results: all 5 strategies generate 200+ trades on training data
  (Jan 2021 - Aug 2023), best profit factors 0.82-0.96 on select pairs
- Trade logs and reports saved for Phase 3 ML feature engineering

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Brent Neale
2026-02-18 06:04:40 +10:00
co-authored by Claude Opus 4.6
parent 5d7f6c60a9
commit dce54845c2
103 changed files with 26083 additions and 123 deletions
+26
View File
@@ -0,0 +1,26 @@
time,strategy,instrument,granularity,side,price,position_size,equity,drawdown,pnl
2024-01-30 05:30:00+00:00,S5_Momentum_Exhaustion,EUR_CAD,M15,BUY,1.45093,1500.0,100000.0,0.0,0.0
2024-01-30 06:45:00+00:00,S5_Momentum_Exhaustion,EUR_CAD,M15,SL_EXIT_LONG,1.450350357142857,0.0,99999.4,0.0,-0.6
2024-01-30 07:15:00+00:00,S5_Momentum_Exhaustion,EUR_CAD,M15,BUY,1.45016,1499.99,99999.4,0.0,0.0
2024-01-30 10:30:00+00:00,S5_Momentum_Exhaustion,EUR_CAD,M15,TP1_LONG,1.45215332890413,899.99,100000.23,0.0,0.82
2024-01-30 10:30:00+00:00,S5_Momentum_Exhaustion,EUR_CAD,M15,TP2_LONG,1.4510757142857142,300.0,100000.6,0.0,0.38
2024-01-30 10:30:00+00:00,S5_Momentum_Exhaustion,EUR_CAD,M15,TP3_LONG,1.4517624999999998,0.0,100000.94,0.0,0.33
2024-01-30 13:00:00+00:00,S5_Momentum_Exhaustion,EUR_CAD,M15,SELL_SHORT,1.45641,1500.01,100000.94,0.0,0.0
2024-01-30 18:00:00+00:00,S5_Momentum_Exhaustion,EUR_CAD,M15,TP1_SHORT,1.45320875151639,900.01,100002.25,0.0,1.32
2024-01-30 18:00:00+00:00,S5_Momentum_Exhaustion,EUR_CAD,M15,TP2_SHORT,1.45461,300.0,100003.0,0.0,0.74
2024-01-30 18:00:00+00:00,S5_Momentum_Exhaustion,EUR_CAD,M15,TP3_SHORT,1.45326,0.0,100003.65,0.0,0.65
2024-01-31 12:30:00+00:00,S5_Momentum_Exhaustion,EUR_CAD,M15,SELL_SHORT,1.45605,1500.05,100003.65,0.0,0.0
2024-01-31 14:45:00+00:00,S5_Momentum_Exhaustion,EUR_CAD,M15,SL_EXIT_SHORT,1.4573164285714286,0.0,100002.34,0.0,-1.3
2024-02-05 20:45:00+00:00,S5_Momentum_Exhaustion,EUR_CAD,M15,SELL_SHORT,1.45456,1500.04,100002.34,0.0,0.0
2024-02-06 03:45:00+00:00,S5_Momentum_Exhaustion,EUR_CAD,M15,TP1_SHORT,1.45277725230381,900.02,100003.08,0.0,0.74
2024-02-06 03:45:00+00:00,S5_Momentum_Exhaustion,EUR_CAD,M15,TP2_SHORT,1.4533142857142858,300.01,100003.59,0.0,0.51
2024-02-06 04:30:00+00:00,S5_Momentum_Exhaustion,EUR_CAD,M15,TRAIL_SL_SHORT,1.452865,0.0,100003.94,0.0,0.35
2024-02-06 17:45:00+00:00,S5_Momentum_Exhaustion,EUR_CAD,M15,BUY,1.45003,1500.06,100003.94,0.0,0.0
2024-02-07 07:45:00+00:00,S5_Momentum_Exhaustion,EUR_CAD,M15,TP1_LONG,1.4523581365203,900.04,100004.9,0.0,0.96
2024-02-07 07:45:00+00:00,S5_Momentum_Exhaustion,EUR_CAD,M15,TP2_LONG,1.45196,300.01,100005.7,0.0,0.8
2024-02-07 08:00:00+00:00,S5_Momentum_Exhaustion,EUR_CAD,M15,TRAIL_SL_LONG,1.45207,0.0,100006.12,0.0,0.42
2024-02-08 14:00:00+00:00,S5_Momentum_Exhaustion,EUR_CAD,M15,BUY,1.44873,1500.09,100006.12,0.0,0.0
2024-02-08 14:45:00+00:00,S5_Momentum_Exhaustion,EUR_CAD,M15,TP1_LONG,1.45047619184842,900.06,100006.85,0.0,0.72
2024-02-08 14:45:00+00:00,S5_Momentum_Exhaustion,EUR_CAD,M15,TP2_LONG,1.45027,300.02,100007.48,0.0,0.64
2024-02-08 15:00:00+00:00,S5_Momentum_Exhaustion,EUR_CAD,M15,TRAIL_SL_LONG,1.4493964285714285,0.0,100007.62,0.0,0.14
2024-02-12 15:45:00+00:00,S5_Momentum_Exhaustion,EUR_CAD,M15,BUY,1.44805,1500.11,100007.62,0.0,0.0
1 time strategy instrument granularity side price position_size equity drawdown pnl
2 2024-01-30 05:30:00+00:00 S5_Momentum_Exhaustion EUR_CAD M15 BUY 1.45093 1500.0 100000.0 0.0 0.0
3 2024-01-30 06:45:00+00:00 S5_Momentum_Exhaustion EUR_CAD M15 SL_EXIT_LONG 1.450350357142857 0.0 99999.4 0.0 -0.6
4 2024-01-30 07:15:00+00:00 S5_Momentum_Exhaustion EUR_CAD M15 BUY 1.45016 1499.99 99999.4 0.0 0.0
5 2024-01-30 10:30:00+00:00 S5_Momentum_Exhaustion EUR_CAD M15 TP1_LONG 1.45215332890413 899.99 100000.23 0.0 0.82
6 2024-01-30 10:30:00+00:00 S5_Momentum_Exhaustion EUR_CAD M15 TP2_LONG 1.4510757142857142 300.0 100000.6 0.0 0.38
7 2024-01-30 10:30:00+00:00 S5_Momentum_Exhaustion EUR_CAD M15 TP3_LONG 1.4517624999999998 0.0 100000.94 0.0 0.33
8 2024-01-30 13:00:00+00:00 S5_Momentum_Exhaustion EUR_CAD M15 SELL_SHORT 1.45641 1500.01 100000.94 0.0 0.0
9 2024-01-30 18:00:00+00:00 S5_Momentum_Exhaustion EUR_CAD M15 TP1_SHORT 1.45320875151639 900.01 100002.25 0.0 1.32
10 2024-01-30 18:00:00+00:00 S5_Momentum_Exhaustion EUR_CAD M15 TP2_SHORT 1.45461 300.0 100003.0 0.0 0.74
11 2024-01-30 18:00:00+00:00 S5_Momentum_Exhaustion EUR_CAD M15 TP3_SHORT 1.45326 0.0 100003.65 0.0 0.65
12 2024-01-31 12:30:00+00:00 S5_Momentum_Exhaustion EUR_CAD M15 SELL_SHORT 1.45605 1500.05 100003.65 0.0 0.0
13 2024-01-31 14:45:00+00:00 S5_Momentum_Exhaustion EUR_CAD M15 SL_EXIT_SHORT 1.4573164285714286 0.0 100002.34 0.0 -1.3
14 2024-02-05 20:45:00+00:00 S5_Momentum_Exhaustion EUR_CAD M15 SELL_SHORT 1.45456 1500.04 100002.34 0.0 0.0
15 2024-02-06 03:45:00+00:00 S5_Momentum_Exhaustion EUR_CAD M15 TP1_SHORT 1.45277725230381 900.02 100003.08 0.0 0.74
16 2024-02-06 03:45:00+00:00 S5_Momentum_Exhaustion EUR_CAD M15 TP2_SHORT 1.4533142857142858 300.01 100003.59 0.0 0.51
17 2024-02-06 04:30:00+00:00 S5_Momentum_Exhaustion EUR_CAD M15 TRAIL_SL_SHORT 1.452865 0.0 100003.94 0.0 0.35
18 2024-02-06 17:45:00+00:00 S5_Momentum_Exhaustion EUR_CAD M15 BUY 1.45003 1500.06 100003.94 0.0 0.0
19 2024-02-07 07:45:00+00:00 S5_Momentum_Exhaustion EUR_CAD M15 TP1_LONG 1.4523581365203 900.04 100004.9 0.0 0.96
20 2024-02-07 07:45:00+00:00 S5_Momentum_Exhaustion EUR_CAD M15 TP2_LONG 1.45196 300.01 100005.7 0.0 0.8
21 2024-02-07 08:00:00+00:00 S5_Momentum_Exhaustion EUR_CAD M15 TRAIL_SL_LONG 1.45207 0.0 100006.12 0.0 0.42
22 2024-02-08 14:00:00+00:00 S5_Momentum_Exhaustion EUR_CAD M15 BUY 1.44873 1500.09 100006.12 0.0 0.0
23 2024-02-08 14:45:00+00:00 S5_Momentum_Exhaustion EUR_CAD M15 TP1_LONG 1.45047619184842 900.06 100006.85 0.0 0.72
24 2024-02-08 14:45:00+00:00 S5_Momentum_Exhaustion EUR_CAD M15 TP2_LONG 1.45027 300.02 100007.48 0.0 0.64
25 2024-02-08 15:00:00+00:00 S5_Momentum_Exhaustion EUR_CAD M15 TRAIL_SL_LONG 1.4493964285714285 0.0 100007.62 0.0 0.14
26 2024-02-12 15:45:00+00:00 S5_Momentum_Exhaustion EUR_CAD M15 BUY 1.44805 1500.11 100007.62 0.0 0.0