A comprehensive breakdown of each layer in the Scalable Brain execution pipeline
No strategy touches live market data until it proves a mathematical edge. This layer operates entirely offline, acting as a rigorous scientific testing ground. The system treats each strategy as a hypothesis that must be validated through statistical evidence.
Strategies marked PROMOTED are inserted into the Dim_Strategy_Registry SQL table. Rejected strategies are logged with reasons for future research.
src/research/layer0_multi_asset_evaluator.py
Markets behave differently in different conditions. A trend-following strategy that thrives in strong trends will bleed in a sideways market. Layer 1 independently classifies the "weather" for each asset so downstream layers can make informed decisions.
| Regime | ATR | ADX | Market Condition |
|---|---|---|---|
| Trending_HighVol | High | High | Strong directional moves with large candles |
| Trending_LowVol | Low | High | Steady trends with small-bodied candles |
| Ranging_HighVol | High | Low | Choppy, volatile, no clear direction |
| Ranging_LowVol | Low | Low | Quiet, tight-range consolidation |
ingest_regimes.py fetches 10,000+ hours of H1 data per asset, applies K-Means clustering, and writes regime labels to the Fact_Market_Regime SQL table with timestamps, ATR, and ADX values.
src/layer1_regime/regime_clustering.py | src/layer1_regime/ingest_regimes.py
Promoted strategies from Layer 0 run continuously on live market data. They scan for entry conditions and emit raw signals. Critically, these signals are never sent directly to the broker—they must pass through the AI Gatekeeper first.
| Strategy | Type | Entry Logic |
|---|---|---|
| Trend_EMA_ADX | Trend | 50/200 EMA crossover + ADX > 25 |
| Range_Bollinger | Range | Bollinger Band reversion + RSI < 30 |
| Trend_Donchian | Trend | 20-period Donchian channel breakout |
| Range_Stochastic | Range | Stochastic oversold bounce |
The ML model does not predict price. It evaluates the historical probability of a specific strategy succeeding in the current market regime. This is meta-labeling: the model labels the quality of the signal, not the direction of the market.
| Parameter | Value |
|---|---|
| Algorithm | XGBoost (multi:softprob) |
| Classes | BUY (1), HOLD (0), SELL (-1) |
| Boosting Rounds | 300 |
| Max Depth | 4 (shallow to prevent overfitting) |
| Learning Rate | 0.05 (conservative) |
| Subsample | 0.8 |
| Train/Test Split | 70/30 chronological |
| Confidence Threshold | 0.75 |
24-hour lookahead determines if a trade would hit 2x ATR profit before 1x ATR loss. This creates a strict 1:2 R/R ground truth for training.
archieved/src/ml/feature_engineering.py | archieved/src/ml/train_xgboost.py
Provides real-time visibility into every layer of the system. Designed for human oversight, not automation.
Python Streamlit for rapid iteration, with Power BI as a reporting companion.
| Table | Purpose |
|---|---|
| Dim_Asset | Symbol registry (EUR_USD, GBP_USD, USD_JPY) |
| Dim_Market_Regime | Regime definitions and volatility indices |
| Dim_Strategy_Registry | Promoted strategy names and logic descriptions |
| Dim_Indicator_Library | Technical indicator catalog |
| Dim_Model_Metadata | ML model versions and training metadata |
| Table | Purpose |
|---|---|
| Fact_Market_Prices | OHLCV candles (H1 granularity) |
| Fact_Indicator_Values | Pre-calculated indicator values |
| Fact_Signals | Raw signals with confidence scores |
| Fact_Trade_Results | Executed trades with P&L |
| Fact_Market_Regime | Regime classifications per asset per timestamp |