AI-driven FX research, validation, and alpha discovery framework.
deepfx-alpha-lab is a research-oriented repository for validating AI-based FX signals, especially Kronos shadow signals, under realistic trading assumptions.
The goal is not simply to ask:
“Does Kronos predict the market correctly?”
Instead, the real research question is:
“Under which market conditions, holding windows, cost structures, and risk constraints does Kronos provide a repeatable edge that can be used as a practical trade filter?”
DeepFX Alpha Lab focuses on building a disciplined research loop for AI-assisted FX trading.
The repository is designed to help answer questions such as:
- Did the signal reach take-profit before stop-loss?
- Did the signal survive spread, slippage, and transaction costs?
- Does the edge remain stable across sessions, symbols, and volatility regimes?
- Is the observed performance statistically meaningful?
- Is the strategy overfitted to a specific window or parameter set?
- Can a meta-model decide when to trade or skip a Kronos signal?
Most trading research fails not because the model is weak, but because the validation process is contaminated.
This repository prioritizes:
- Realistic labeling
- Proper financial cross-validation
- Backtest overfitting prevention
- Cost-aware evaluation
- Regime/session-based performance analysis
- Meta-labeling for trade/no-trade filtering
In other words:
Signal
→ Label
→ Validate
→ Penalize overfitting
→ Meta-filter
→ Deploy
Instead of labeling a signal by simple next-candle direction, DeepFX Alpha Lab uses the Triple Barrier Method.
For each signal timestamp t0, three barriers are defined:
- Upper barrier: take-profit
- Lower barrier: stop-loss
- Vertical barrier: maximum holding time
The final label is determined by which barrier is reached first.
Example labels:
| Label | Meaning |
|---|---|
+1 |
Take-profit reached first |
-1 |
Stop-loss reached first |
0 |
Time-out or inconclusive outcome |
This is more realistic than simple direction prediction because it reflects the actual trading structure of TP, SL, and holding window.
Kronos can be treated as a primary signal generator.
Example:
Kronos says LONG
A secondary model then decides:
Should we actually take this LONG trade?
The meta-labeling model focuses on trade filtering:
| Primary Model | Meta Model |
|---|---|
| Predicts direction | Decides trade/no-trade |
| Generates LONG/SHORT signal | Filters low-quality signals |
| Captures market opinion | Controls execution quality |
Candidate meta-model features:
- Kronos confidence
- Realized volatility
- Spread proxy
- Trading session: Asia / London / New York
- Recent trend or reversal strength
- Agreement with existing strategy signal
- Recent loss state
- News-like spike condition
- Volatility bucket
- Regime classification
Financial time series data is highly vulnerable to leakage.
DeepFX Alpha Lab uses finance-specific validation methods such as:
- Purged K-Fold Cross-Validation
- Embargo
- Walk-forward validation
- Combinatorial Purged Cross-Validation
These methods help prevent future information from leaking into the training set.
A good Sharpe ratio can be misleading when many strategies, thresholds, symbols, or time windows are tested.
The Deflated Sharpe Ratio helps answer:
“Is this Sharpe ratio still meaningful after accounting for selection bias, non-normality, and multiple testing?”
This is important because the best-looking backtest may simply be the result of overfitting.
When many parameter combinations are tested, the selected best strategy often fails out-of-sample.
DeepFX Alpha Lab uses the Probability of Backtest Overfitting concept to estimate whether an apparent edge is robust or just a lucky artifact.
The first MVP focuses on Kronos shadow signal validation.
Kronos shadow signal
→ Triple barrier label
→ Session / regime / volatility bucket analysis
→ Purged walk-forward validation
→ DSR / PBO overfitting penalty
→ Meta-label model
→ Trade / no-trade decision
-
Collect Kronos shadow signals
-
Attach triple-barrier labels to each signal
-
Analyze performance by:
- Symbol
- Session
- Volatility bucket
- Market regime
- Holding window
- Signal confidence
-
Compare:
- Kronos-only signal
- Existing strategy-only signal
- Kronos + existing strategy agreement
- Kronos disagreement filter
-
Apply purged walk-forward validation
-
Evaluate DSR and PBO
-
Train a simple meta-labeling model for trade/no-trade filtering
deepfx-alpha-lab/
├── README.md
├── docs/
│ ├── research-notes.md
│ ├── labeling.md
│ ├── validation.md
│ ├── backtesting-protocol.md
│ └── references.md
├── data/
│ ├── raw/
│ ├── interim/
│ └── processed/
├── notebooks/
│ ├── 001_triple_barrier_labeling.ipynb
│ ├── 002_kronos_shadow_analysis.ipynb
│ ├── 003_purged_walk_forward_validation.ipynb
│ └── 004_meta_labeling_experiment.ipynb
├── src/
│ └── deepfx_alpha_lab/
│ ├── __init__.py
│ ├── labeling/
│ │ ├── triple_barrier.py
│ │ └── meta_labeling.py
│ ├── validation/
│ │ ├── purged_kfold.py
│ │ ├── embargo.py
│ │ └── walk_forward.py
│ ├── metrics/
│ │ ├── sharpe.py
│ │ ├── deflated_sharpe.py
│ │ └── pbo.py
│ ├── backtesting/
│ │ ├── cost_model.py
│ │ ├── slippage.py
│ │ └── evaluator.py
│ ├── kronos/
│ │ ├── signal_loader.py
│ │ └── shadow_log.py
│ └── research/
│ ├── regime.py
│ ├── session.py
│ └── volatility.py
├── tests/
│ ├── test_triple_barrier.py
│ ├── test_purged_kfold.py
│ └── test_metrics.py
├── scripts/
│ ├── label_kronos_signals.py
│ ├── run_validation.py
│ └── generate_report.py
└── pyproject.toml
-
Marcos López de Prado Advances in Financial Machine Learning
Key topics:
- Triple Barrier Labeling
- Meta-labeling
- Purged K-Fold Cross-Validation
- Embargo
- Sequential Bootstrap
- Fractional Differentiation
-
Bailey & López de Prado The Deflated Sharpe Ratio: Correcting for Selection Bias, Backtest Overfitting and Non-Normality
-
Bailey, Borwein, López de Prado, Zhu The Probability of Backtest Overfitting
-
Bailey & López de Prado A Backtesting Protocol in the Era of Machine Learning
These projects are useful as design references, but their licenses and production suitability should be reviewed carefully before direct integration.
-
Repository: https://github.com/hudson-and-thames/mlfinlab
-
Useful for:
- Labeling
- Sampling
- Cross-validation
- Backtest statistics
-
Repository: https://github.com/microsoft/qlib
-
Useful for:
- Quant research workflow
- Model prediction pipeline
- Backtesting architecture
-
Repository: https://github.com/polakowo/vectorbt
-
Useful for:
- Fast vectorized backtesting
- Parameter sweep experiments
-
Repository: https://github.com/kernc/backtesting.py
-
Useful for:
- Simple strategy testing
- Lightweight research prototypes
-
Repository: https://github.com/mementum/backtrader
-
Useful for:
- Event-driven backtesting concepts
- Classic strategy research patterns
-
Repository: https://github.com/quantopian/zipline
-
Useful for:
- Event-driven research design
- Historical backtesting architecture
-
Repository: https://github.com/AI4Finance-Foundation/FinRL
-
Useful for:
- Future reinforcement learning experiments
- Action policy optimization
Goal: decide how to label Kronos shadow logs.
- Understand Triple Barrier Method
- Understand Meta-labeling
- Understand Purged K-Fold and Embargo
Goal: understand how to avoid statistical self-deception.
- Read AFML chapters on labeling and cross-validation
- Skim Deflated Sharpe Ratio paper
- Review mlfinlab labeling and validation APIs
Goal: build the first DeepFX research loop.
- Design triple-barrier labeler
- Attach labels to Kronos shadow signals
- Analyze performance by session, symbol, and volatility bucket
- Define purged split criteria
- Compare Kronos-only vs strategy-agreement filters
- Prepare first validation report
DeepFX Alpha Lab starts from this question:
Does Kronos provide a repeatable and cost-adjusted trading edge under specific market regimes, sessions, and holding windows?
Not:
Does Kronos simply predict the next price direction?
This distinction matters because:
- The direction may be correct, but stop-loss may be hit first.
- The trade may reach take-profit, but spread and slippage may erase the edge.
- The signal may work only in a specific session.
- The signal may work only in a specific volatility regime.
- The best threshold may be overfitted.
- A high Sharpe ratio may be the result of multiple testing.
- Define signal schema
- Implement triple-barrier labeling
- Add TP / SL / holding-window configuration
- Generate labeled Kronos shadow dataset
- Analyze win rate by session
- Analyze expectancy by volatility bucket
- Analyze signal quality by confidence score
- Compare symbol-level performance
- Identify unstable regimes
- Implement purged K-Fold validation
- Implement embargo logic
- Implement walk-forward validation
- Add Deflated Sharpe Ratio
- Add Probability of Backtest Overfitting analysis
- Define trade/no-trade target
- Build baseline meta-labeling dataset
- Train simple classifier
- Compare raw Kronos vs meta-filtered Kronos
- Evaluate out-of-sample robustness
- Generate research report
- Summarize edge by regime/session/symbol
- Export experiment results
- Document reproducibility rules
This repository is for research and engineering purposes only.
It does not provide financial advice, investment recommendations, or guaranteed trading strategies. All results must be interpreted with caution and validated under realistic market assumptions, including spread, slippage, latency, transaction costs, and execution risk.