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
+3 -3
View File
@@ -102,7 +102,7 @@ def fetch_candles_from_supabase(instrument, granularity, supabase_client, table)
"""
print(f"Fetching {instrument} / {granularity} from Supabase...")
# Supabase JS-style pagination: fetch in pages of 1000
# Supabase pagination: fetch in pages of 1000
all_rows = []
page_size = 1000
offset = 0
@@ -113,14 +113,14 @@ def fetch_candles_from_supabase(instrument, granularity, supabase_client, table)
.eq("instrument", instrument)
.eq("granularity", granularity)
.order("time", desc=False)
.range(offset, offset + page_size - 1)
.range(offset, offset + page_size)
.execute()
)
rows = resp.data or []
all_rows.extend(rows)
if len(rows) < page_size:
break
offset += page_size
offset += len(rows)
if not all_rows:
print(f" No data found for {instrument} / {granularity}.")