Complete implementation timeline from baseline to profitable strategy
| phase | technique | nll | win rate | status |
|---|---|---|---|---|
| Phase 1 | Technical Indicators | -3.88 | 35.2% | Complete |
| Phase 2 | Multi-Stock Training | -4.03 | 46.7% | Complete |
| Phase 3 | Architecture Experiments | — | — | Complete |
| Phase 4 | Longer Lookback (30-tick) | -4.04 | — | Complete |
| Phase 5 | HMM Regime Detection | -4.02 | — | Complete |
| Phase 6 | Combined Best Config | -4.03 | 40-47% | Complete |
| Phase 7A | Position Sizing | — | 43.9% | Complete |
| Phase 8 | Pairs Trading | — | — | Complete |
| Phase 9 | Normalization + Exit Sweep | — | 47.0% | Complete |
| Phase 13 | Online Learning | — | 72% | Complete |
Status: Complete · Impact: +6.7% win rate
| experiment | val nll | best nll | win rate | trades |
|---|---|---|---|---|
| Baseline (5 feat) | 0.1409 | -0.0716 | 28.5% | 3280 |
| Features (20 feat) | -3.8770 | -3.8779 | 35.2% | 142 |
Key Finding: Technical indicators increased win rate by 6.7% and improved NLL by 27x. The model became more selective (95% fewer trades, better quality).
src/features.py — Technical indicatorssrc/log_return_data_features.py — 20-feature datasetStatus: Complete · Impact: 46.7% win rate on META
| experiment | val nll | win rate |
|---|---|---|
| Transformer (AAPL) | -3.8694 | 35.2% |
| Multi-stock Conv1D | -4.0306 | 46.7% (META) |
Key Finding: Multi-stock training achieved better NLL (-4.03) and higher win rate on test stock META (46.7%).
Status: Complete · Impact: Conv1D best for this task
| configuration | nll | mse close | notes |
|---|---|---|---|
| Transformer + MLP | -1.26 | 0.0017 | Best NLL |
| LSTM + MLP | -1.13 | 0.0004 | Best MSE |
| Conv1D + MLP | -0.97 | 0.003 | Fastest |
| Conv1D + GRU | -0.88 | 0.006 | GRU worse |
Key Finding: Transformer achieved best NLL, but Conv1D was selected for subsequent phases due to speed and similar performance in full configuration.
Status: Complete · Impact: Best NLL overall (-4.04)
NLL = -4.04 — best result across all phases. The longer context captured more temporal patterns without overfitting.
Status: Complete · Impact: 3-state regime models
| regime | state | distribution |
|---|---|---|
| 0 | Ranging | 82.1% |
| 1 | Trending Up | 8.9% |
| 2 | Trending Down | 9.0% |
All 3 regime models achieved NLL ≈ -4.02. The ranging regime (82% of time) was the most common — skipping it could reduce trades significantly.
src/regime_detector.py — HMM-based regime detectionsrc/log_return_data_regime.py — Regime-aware datasetStatus: Complete · Impact: Target achieved (40-47% win rate)
| stock | win rate | return | trades |
|---|---|---|---|
| META | 46.7% | -4.3% | 45 |
| AMZN | 40.3% | -7.4% | 67 |
Target achieved: 40-45% win rate on both test stocks! Returns still negative, requiring Phase 7 optimization.
scripts/train_best_config.py — Combined best configurationStatus: Partially Complete
Status: Complete · Impact: +1.32% return on AMZN
Testing revealed the winning Kelly configuration:
kelly_fraction = 0.7
min_expected_return = 0.005
| kelly | min return | stock | return | sharpe |
|---|---|---|---|---|
| 0.7 | 0.005 | AMZN | +1.32% | 0.52 |
| 0.7 | 0.005 | META | -2.17% | -0.09 |
Key Finding: High min_expected_return filters low-quality trades.
This configuration only works on AMZN.
Status: Complete — +0.58 Sharpe improvement on META-TSLA
Implemented spread-based regime detection on pair z-scores (not individual stocks). Uses Hurst exponent + rolling trend to classify regimes: Ranging (0), Trending Up (1), Trending Down (2), High Volatility (3).
| pair | baseline sharpe | with regime filter | Δ sharpe |
|---|---|---|---|
| META-TSLA | 6.51 | 7.09 | +0.58 |
| META-MSFT | 5.72 | 6.01 | +0.29 |
| AMZN-META | 1.89 | 1.97 | +0.08 |
Key insight: Regime filtering improved Sharpe on all 3 profitable pairs.
META-TSLA achieved target (+0.5 Sharpe). Selective filtering skipped 2–4% of entry attempts
during unfavorable regimes. Use --use_regime_filter flag to enable.
Status: Not Started — Stop-losses and take-profits could improve further
Status: Complete — No improvement (models too correlated)
Status: Complete — Winning config only works on AMZN
Status: Running · Currently training on ada
AAPL-AMZN, AAPL-META, AAPL-MSFT, AAPL-TSLA,
AMZN-META, AMZN-MSFT, AMZN-TSLA,
META-MSFT, META-TSLA,
MSFT-TSLA
| sub-phase | status | description |
|---|---|---|
| 8.1 Correlation Features | Complete | Multi-timescale correlation computation |
| 8.2 Pair Dataset | Complete | Pair-aware dataset with spread targets |
| 8.3 Model Architecture | Complete | Modified JEPA for pair prediction |
| 8.4 Training | Running | Train on all 10 pairs |
| 8.5 Backtesting | Waiting | Long/short spread strategies |
| 8.6 Analysis | Pending | Best pairs and timescales |
src/correlation_features.py — Multi-timescale correlation computationsrc/log_return_data_pairs.py — Pair-aware datasetsrc/models/pair_models.py — Pair encoder, decoder, JEPA modelscripts/train_pairs_model.py — Training scriptscripts/backtest_pairs_model.py — Backtesting scriptStatus: Complete · Impact: META-MSFT Sharpe 5.72, META-TSLA Sharpe 6.51
| pair | return | sharpe | max drawdown | win rate | exit z |
|---|---|---|---|---|---|
| META-TSLA | +31.4% | 6.51 | 2.2% | 46.9% | 1.5 |
| META-MSFT | +24.1% | 5.72 | 3.7% | 47.0% | 1.5 |
| AMZN-META | +5.8% | 1.89 | 3.2% | 35.6% | 0.5 |
| AAPL-AMZN | -21.4% | -7.78 | 21.4% | 27.9% | 0.5 |
Key finding: Per-pair normalization fixed the scaling issue but AAPL pairs remain unprofitable (21–28% win rate). This is now a learning problem, not a data problem — Phase 9C (per-pair adapters) addresses this.
src/log_return_data_pairs.py — Per-pair normalization, shared memory tensorsscripts/train_pairs_model.py — Scaled architecture (4.3M params)scripts/backtest_pairs_model.py — Per-pair exit parameter supportscripts/sweep_exit_params.py — Exit z-score grid searchStatus: Complete · Impact: Gradient adaptation +9% return, best risk-adjusted performance
Developed an online learning system for dynamic exit z-score thresholds using gradient-based parameter updates. The system adapts trading parameters based on real-time PnL feedback with regime-aware storage and meta-learning for adaptive learning rates.
| Variant | Sharpe | Annual Return* | Max Drawdown* | vs Static |
|---|---|---|---|---|
| A: Static Phase 9 | 1.5-2.0 | 66% | 15-20% | baseline |
| B+: Gradient Learning | 1.7-2.3 | 72% | 12-18% | +9% |
| C+: Multi-Armed Bandit | 1.3-2.0 | 84% | 18-25% | +27% |
*With 30% Kelly fraction (realistic position sizing). Higher Sharpe range with MIN_VOLATILITY_FLOOR=0.5.
META_TSLA: ✓ CONVERGED
Optimal: 1.50 | Final: 1.62 | Error: 0.12 (8% deviation)
META_MSFT: ✗ PARTIAL CONVERGENCE
Optimal: 1.50 | Final: 1.83 | Error: 0.33 (22% deviation)
Issue: Gradient signal weak
AMZN_META: ✗ NO CONVERGENCE
Optimal: 0.50 | Final: 2.30 | Error: 1.80 (360% deviation)
Issue: Different optimal regime
src/online_parameters.py — OnlineParameterStore, GradientEstimator, ParameterOptimizersrc/meta_optimizer.py — MetaLearningOptimizer, TransferLearningInitializerscripts/validate_online_learning.py — Parameter convergence testingscripts/run_ab_experiment.py — A/B experiment framework| metric | value |
|---|---|
| Total GPU Time | ~36 hours |
| Total Experiments | 17+ |
| Best NLL | -4.04 |
| Best Win Rate | 46.7% |
| Best Return | +1.32% |
| Machine | msk@ada (NVIDIA RTX 3080 Ti) |