S8_OB PASS: best params DISP_ATR=2.5, TP1=2.0, Window=40
(IS PF=1.39, OOS PF=1.59, Gen=1.382). S9_Filtered also PASS.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implemented two M15 intraday strategies to diversify the portfolio:
- S10: VWAP mean reversion in ranging markets (ADX<30, RSI(9) extremes)
- S11: ADX trend pullback to 20 EMA in strong trends (ADX>30, rising)
Added rsi_9 and atr_10 to the indicator pipeline for both strategies.
Backtested on IS (2021-2022) and OOS (2023): both strategies produced
insufficient trade counts on M15 and failed generalization. S10 best
result was EUR_GBP at Gen 0.65 (WARN). S11 collapsed to 0% WR OOS
across all param sweep combos. Both dropped from active portfolio —
3-strategy core (S7_Tight, S9_Filtered, S3) remains unchanged.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
S7: add RSI floor (RSI<40 = 0% WR) and ATR percentile cap (high-vol
regime = worse RR). IS flips from PF 0.68 to 1.52, OOS holds at 1.80.
S3: add confluence gate (C>=4) and skip hours 09-10 (0% WR). IS PF
1.06 -> 1.22, OOS PF 1.07 -> 1.23.
S9_Filtered: add skip_monday (unreliable Asian ranges after weekend
gaps). IS PF 1.10 -> 1.31, OOS holds strong at 2.26.
Drop S9/GBP_USD (negative PF across all param combos) and S4F/EUR_AUD
(overfit: IS 1.43 collapses to OOS 0.48). 3-strategy portfolio: all
PASS generalization, IS PF 1.29, OOS PF 1.55, Gen 1.46.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Externalize hardcoded params in S4F (5 params) and S3 (9 params) as class
attributes for sweep compatibility. Add unified backtest runner with IS/OOS
validation and generalization scores, plus parameter grid sweep (90 combos)
with OOS validation. S7/S9/S9_Filtered pass generalization; S4F/S3 confirm
defaults are near-optimal.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add Railway cloud deployment section with service URLs, env vars,
persistent volume, and known limitations. Update project structure
with railway.toml and health.py. Update dashboard and bot run sections.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Dockerfile: add templates copy, ENV PORT, update CMD to live engine
- Create src/live/health.py: threaded HTTP health server (/health, /state)
- Wire health server into src/live/run.py before engine loop
- Dashboard: add unauthenticated /health endpoint, use PORT env var
- Create railway.toml with Dockerfile builder and health check config
- docker-compose.yml: rename service to live-engine, add PORT env vars
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Introduces a full Trading Economics API pipeline that fetches, stores, and
queries economic events (NFP, CPI, rate decisions, etc.) so the backtester
can block trade entries within a configurable buffer window of high-impact
releases — reducing slippage and false signals.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
New strategy (pivot_retest_engulfing) that enters long/short trades at
pivot level retests confirmed by SMA 50 alignment and engulfing candle
patterns. Uses ATR-based stop loss with two take-profit levels — at TP1
half the position closes and SL moves to breakeven, at TP2 the rest closes.
- data_engine: add detect_engulfing() for bullish/bearish pattern detection
- backtester: add generate_signals_pivot_retest(), run_backtest_dual_tp(),
update signal dispatcher and metrics for dual-TP trade format
- order_executor: support signal=-1 (SHORT), attach SL/TP levels
- config: switch to pivot_retest_engulfing with default params
- chart_trades: new mplfinance script to visualize entries on candlesticks
- README: rewrite with full setup guide, project structure, strategy docs
- requirements.txt: make portable (remove conda file:// paths), add mplfinance
- .env.example: add template for secrets
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add Classic Pivot Points (P, R1-R3, S1-S3) computed from previous day's
OHLC data, displayed as horizontal lines on an interactive Plotly.js
candlestick chart at /chart with instrument/granularity selectors.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Added parameter sweep tool that tested 320 combinations across SMA periods,
trade sizes, and RSI filters. Best result: SMA 50/100 on M15 with RSI 80/20
(Sharpe 5.69, 49% win rate). Updated backtester with RSI overbought/oversold
signal filtering and config to match optimal parameters.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add Flask dashboard with status, config editor, logs, kill switch,
and backtest results pages with monthly P&L breakdowns
- Add historical_loader.py for paginated OANDA candle fetching (1yr+)
- Update backtester to $100k starting equity, monthly P&L computation,
and JSON summary output for dashboard display
- Update config to EUR_USD only on M5/M15 with SMA 21/50 strategy
- Add backtest.html template with performance metrics and bar charts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Dockerize the order executor with python:3.11-slim, add docker-compose
with config volume mount for hot-reload of system.yaml settings. Integrate
AI ensemble validation into order execution pipeline and add configurable
interval loop (default 60s) to replace container restart cycling.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reads features from Supabase, simulates SMA(3)/SMA(20) crossover signals,
and outputs P&L, drawdown, and trade logs per instrument/granularity.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sanitize NaN/inf values that pandas re-introduces into float columns
after conversion, preventing JSON serialization errors. Fix upsert
response check to detect success via resp.data instead of status_code.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Track granularity (M1/M5) through the pipeline so rows are
distinguishable after upload. Drop helper columns (tr, typical_price,
pv) from the feature DataFrame. Add SQL schema with composite PK on
(time, instrument, granularity).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Create config/system.yaml with full master prompt template
- Create src/config_loader.py to load YAML config and .env
- Update data_engine.build_all_features() to support lists of windows
(e.g. sma_windows: [3, 20] produces sma_3 and sma_20 columns)
- Rewrite get_candles.py to loop over all instruments × granularities
from config instead of hardcoding EUR_USD/M5
- Fix supabase_upload.py indentation bug and wire up config for table name
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>