Command center
Markets, funds, signals and risk in a single view.
Data coverage — daily ingestion check
Distinct tickers loaded per day and per timeframe. A strategy built on incomplete data is not reliable — this is where you catch the days that did not load, or loaded only halfway.
—
| Date | 1d | 4h | 1h | 30m | 15m | 5m |
|---|
Green = full (≥98% of the best recent day) · Amber = partial · Red = missing on a
trading day · Grey = weekend / market closed or timeframe not downloaded.
Generated by agents/agente_data_coverage.py.
Quick ranking
| Ticker | Class | 1d return | 20d momentum | 20d vol | Score |
|---|
Distribution
Normalized evolution
Base 100 to compare assets with different price levels. Ideal for spotting momentum and relative rotation.
20d Momentum
Quick read of recent strength per asset.
20d Volatility
Relative risk before discussing position sizing.
Active universe (S&P 500 momentum + open positions + legacy)
Leonex rotates the universe weekly: downloads all 500 S&P components, computes 60d momentum and keeps the top-30. It ALWAYS includes tickers with open positions (to manage TP/SL/timeout even si they fall out of the top) plus legacy crypto/forex assets that we keep monitoring.
| Rank | Ticker | 60d momentum score | Class | Motivo |
|---|
Changes vs previous universe
| Change | Ticker | Actual rank | Score |
|---|
—
| Ticker | Class | Close | Date | 1d return | 20d mom | 60d mom | 20d vol | 20d Z | Decision |
|---|
Regime per asset
Classification based on ADX, ATR and SMA-50. Generated by agent_regimen.py
| Ticker | Date | Regime | ADX | ATR | SMA-50 | Close | Vs SMA-50 |
|---|
Interpretation guide
ADX > 25 + Price > SMA-50
The asset has strong directional momentum and trades above its 50-session average. Favorable regime for trend-following strategies.
ADX > 25 + Price < SMA-50
Strong trend but to the downside. Avoid long positions. May be a favorable environment for hedging or short strategies.
ADX < 25
Market with no clear direction. ADX indicates trend weakness. More appropriate for mean reversion than for momentum.
ATR > 2x mean 60d ATR
Abnormally high volatility vs recent history. Market stress signal. Reduce exposure, widen stops or exit.
agent_senales.py:
momentum in UPTREND, mean reversion (RSI<30) in SIDEWAYS, flat in CRISIS or BEARISH.
Validated with Walk-Forward + DSR + Monte Carlo
(agent_validacion.py --strategy regime_adaptive_v1_lo).Carrier Health — read honesto del legacy
Síntesis cruda de los 3 indicadores de salud del carril
regime_adaptive_v1_lo + Meta-Labeling. Si discrepan, este panel
resume qué creer y qué no. El bridge de estrategias promovidas (Strategy Lab)
tiene su propia validación independiente (DSR ≥ 0.80, walk-forward, permutación) y
no se ve afectado por la salud aquí.
—
—
—
—
—
Intraday Timeframe Selector (Phase A — diagnostic)
For each asset, the Sharpe of a simple momentum strategy is computed across three timeframes (daily, 1h, 4h)
and the winner is chosen. Anti-flip: it only switches from daily to intraday if the improvement exceeds 0.20 Sharpe.
Current phase = diagnostic only. The rollout (having regime/signals/Meta operate on the chosen timeframe) comes
later with your confirmation. Generate the card with:
python agents/agente_datos_intraday.py →
python agents/agente_timeframe_selector.py.
—
| Ticker | Chosen | Sharpe (chosen) | Sharpe daily | Sharpe 1h | Sharpe 4h | Margin vs 2nd |
|---|
Strategy Lab v3 — strategies scored by their trades (anti-overfitting)
Each strategy = entry trigger + regime filter + exit config (take-profit / stop-loss /
timeout). 24 entry triggers in three families — momentum/trend (volume-confirmed breakouts, aligned EMA
reclaim, Donchian, MACD, ATR breakout, VWAP), mean-reversion (RSI extremes, Bollinger, down-streaks,
Japanese candles), and multi-indicator confluence (entries that need two or three indicators to agree
at the same time) — × 5 regime filters (strong uptrend, range-bound, pullback-in-uptrend,
volatility expansion, plus unconditioned) × 4 exit configs = 480 strategies per asset.
Crossing each trigger with each regime is what turns a loose indicator into a strategy with economic
sense — a breakout in a trend is not the same trade as a breakout in a range. Every strategy is scored
on its TRADES — each
entry opens a discrete trade closed by TP / SL / timeout (Triple Barrier) — not on daily
bars, so a buy-and-hold fluke with 2 trades can no longer rank high. The winner is picked by the
Deflated Sharpe Ratio over trade returns (sample size = number of trades), validated
walk-forward out-of-sample, and a strategy needs 40+ trades for GOLD / 25+ for
SILVER. Every strategy is evaluated on 1d, 4h and 1h (the TF column) — intraday
timeframes produce hundreds of trades per strategy, where the statistics are strong enough for SILVER/GOLD
to be reachable honestly. Generate with: python agents/agente_strategy_lab.py.
—
| Tier | Ticker | TF | Strategy | Sharpe | DSR | OOS | $10k → | Return | Trades | Win rate | Promote |
|---|
How to activate a winning strategy
Copy the command from the "Promote" column and run it in the container terminal (EasyPanel → leonex-server
→ console). That records your choice in the asset_strategies table, and the
Strategy Tracker below immediately starts a forward paper test of it.
Top-20 Rotation — bridge activo del momento
En vez de operar para siempre las estrategias que un dia fueron GOLD, la rotacion semanal rankea TODOS los
candidatos elegibles de los 3 Labs (swing + scalping + custom) y selecciona las N mejores
(default 20). Solo esas operan en el bridge. Las que salen del top quedan en histórico
(active=0), no se borran. Anti-flicker: una entrada con menos de 4 semanas en
el top se mantiene aunque caiga del ranking — evita "intercambios cosmeticos".
Genera con python agents/agente_top20_selector.py --execute.
La rotación NO está activa todavía. Sin `agente_top20_selector` ejecutado, el bridge sigue operando todas las promovidas históricas (comportamiento anterior). Para activarla, lanza el agente con --execute.
Entered last rotation
Exited last rotation
Protected (anti-flicker)
| # | Ticker | Strategy | TF | Tier | DSR / PSR | Source | Weeks in top |
|---|
Strategy Tracker — forward paper test of promoted strategies
When you --promote a strategy from the Strategy Lab, this tracker starts a
genuine out-of-sample paper test: from that moment it counts only the trades whose entry
happens after tracking began — data that was NOT used to pick the strategy. The Strategy
Lab's backtest looks at the past; this measures whether the edge is real on NEW data. If a strategy holds
up here its edge is genuine; if it falls apart it was overfitting that slipped through. No Alpaca orders —
pure paper. Generate with python agents/agente_strategy_tracker.py.
—
| Ticker | TF | Strategy | Tracking since | Fwd trades | Fwd win rate | $10k → | Fwd return | Status |
|---|
CPCV + PBO (Combinatorial Purged Cross-Validation — Lopez de Prado AFML ch.12)
CPCV splits trades into N groups and runs every combination of k test groups, producing C(N,k) parallel backtest paths with purge & embargo. The result is an empirical distribution of Sharpe ratios instead of a single point. PBO (Probability of Backtest Overfitting, Bailey-Borwein-Lopez de Prado-Zhu 2014) measures how often the best in-sample configuration falls in the bottom half out-of-sample: low PBO = robust, high PBO = noise.
—
Configurations tested (Meta probability thresholds)
| Threshold | Mean train Sharpe (IS) | Mean test Sharpe (OOS) | Overfit gap | % paths best IS | % paths best OOS |
|---|
Path-level detail (first 50)
| Path | Train N | Test N | Purged | Embargo | Best IS thr | Sharpe IS | Sharpe OOS | OOS rank |
|---|
Drift Monitor (live system health)
Compares rolling metrics of the most recent
60 trades against historical baselines. If the system degrades enough, the
PAUSE_NEW_TRADES flag activates and the executor stops opening new positions (close_monitor
keeps managing open ones until they exit).
| Metric | Recent | Baseline | RED threshold | Status | Note |
|---|
—
Recent drift evaluation history
| Date | Status | Pause | N | Sharpe | WinRate | PF | DD |
|---|
Risk Monitor (event-driven live)
Real-time portfolio risk engine. Tracks drawdown vs HWM, daily P&L, position concentration, leverage,
distance to Triple-Barrier stop-loss and market volatility spikes. Any CRITICAL event
triggers the same PAUSE_NEW_TRADES flag used by the Drift Monitor — the executor stops opening
new positions while the Close Monitor keeps managing open ones. Reset with
agent_risk_monitor.py --reset-pause once the cause is resolved.
Active events (this run)
| Kind | Severity | Ticker | Value | Threshold | Message |
|---|
Recent event history
| Timestamp | Kind | Severity | Ticker | Value | Message |
|---|
Equity curve (last 90 days)
HRP Sizing (Hierarchical Risk Parity)
When there are 2+ operable signals, Leonex assigns weights band risk contribution following the Lopez de Prado algorithm (AFML ch.16). Less volatile and less correlated assets get more weight. No matrix inversion — robust against estimation errors. With only 1 signal it keeps the fixed 5% sizing.
| Rank | Ticker | Weight | $ per $10K | Annual vol | Distribution |
|---|
—
Causal Analysis (PC algorithm — Lopez de Prado ADIA 2026)
The Peter-Clark (PC) algorithm builds a causal DAG from conditional independence tests. It identifies which features are real CAUSES of the return (vs simple spurious correlations). This is the foundation of Causal Factor Investing: re-training Meta-Labeling restricted to causal features improves out-of-sample robustness and resists regime changes.
Causes of the return (CAUSAL)
Spurious correlations (DO NOT USE as predictors)
DAG edges with strength
| Source | Type | Target | Strength |
|---|
—
LLM Explanation (local Ollama) —
Optional model that interprets the DAG in plain text. No tokens, no internet, all local.
To activate: .\tools\install_ollama.ps1 install
Fractional Differentiation (Lopez de Prado AFML cap. 5)
Diagnostic / preparatory. For each ticker, searches the minimum fractional order
d ∈ [0, 1] that makes log(price) stationary (ADF p ≤ 0.05).
With d~0.4 it is typically possible to preserve >80% of the original memory while gaining
stationarity — required if we ever feed raw price as a feature into the Meta. Currently the Meta
uses already-stationary features (RSI, momentum, sigma, regimes), so this card is informational.
Run manually with: python agents/agente_frac_diff.py.
—
| Ticker | n obs | ADF p (d=0) | d_min | ADF p (d_min) | Corr with original | Verdict |
|---|
POOLED Portfolio Validation
Aggregates trades from all assets into a single chronological series and applies Walk-Forward + DSR + Bootstrap-H0. This indicator measures whether the system has edge, not whether each isolated asset has it.
—
Daily signal per asset
Joint reading of signals_report.json +
validation_report.json.
The verdict reflects whether the adaptive strategy passed the four filters: Walk-Forward Sharpe > 0,
consistency ≥ 50%, DSR ≥ 0.95 and MC p-value < 0.05.
| Ticker | Last day | Regime | RSI 14 | Mom 20d | Signal | WF Sharpe | DSR | MC p | Verdict |
|---|
Adaptive strategy rules
Long Momentum
Long (+1) if the 20-day return is positive. Exploits directional persistence when the ADX confirms the trend.
Mean reversion
Long if RSI(14) < 30 (oversold). In long-short mode, short if RSI > 70. Bets on reversion to the mean in directionless markets.
Flat (long-only)
No position by default. In long-short mode, short if 20d momentum < 0. Avoids trading against the confirmed trend.
Out of the market
Abnormal volatility (ATR > 2x 60d average) = full stop. Protecting capital matters more than capturing extreme moves.
Triple Barrier: closed trades
Lopez de Prado style labeling: every signal !=0 is simulated
as a real trade with take-profit (2σ), stop-loss (1σ) and timeout (5 days). Data from the file
dashboard/data/trades_report.json.
| Ticker | Trades | Win rate | Avg return / trade | Total return |
|---|
Latest closed trades
Closed by TP, SL or timeout. The reason is noted in the Exit column.
| Ticker | Entry | Exit | Side | Days | Return | Reason |
|---|
Meta-Labeling: filter trades with ML
LightGBM classifier trained with Walk-Forward on the Triple Barrier trades.
It learns which configuration of regime + RSI + sigma + momentum predicts winners. The final validator uses the trades with
probability ≥ 0.55. Data: dashboard/data/meta_report.json.
Training mode —
—
Sampling uniqueness (Lopez de Prado AFML cap.4) —
When two Triple Barrier trades overlap in time (same ticker, intersecting lifetimes), their information is correlated. Training the Meta with sample_weight = avg_uniqueness corrects for this and prevents the classifier from overestimating Sharpe.
—
—
—
—
—
| prob_win threshold | Accepted trades | % retained | Win rate | Profit Factor | Expectancy | Total return |
|---|
Top features by weight
Custom / PineScript strategies — translated & rigorously evaluated
PineScript runs only inside TradingView — Leonex cannot execute it. So a strategy's
logic (entry / exit rules) is translated into Leonex's model and evaluated here with
the same rigour as the Strategy Lab: discrete trades (TP / SL / timeout), transaction cost deducted,
walk-forward out-of-sample, and a confidence score. With 1 strategy that score is the
PSR (Probabilistic Sharpe Ratio — odds the edge is real given the sample); with 2+
it becomes the DSR, which also discounts multiple testing. To add a strategy, paste
its PineScript to Claude — it gets translated into agents/custom_strategies.py.
Runs only this agent — no S&P 500 re-download — so it finishes in a few minutes. Use it after pasting a new PineScript, or whenever the full pipeline did not reach the Custom Lab step.
—
| Tier | Strategy | TF | Source | Trades | Win rate | PF | Confidence | OOS | $10k → | Return |
|---|
Per-asset breakdown — top 15 tickers per strategy × TF
For each (strategy, TF), the 15 tickers where the rule trades best ranked by tier and PSR. Tier is computed per ticker with its own PSR — a rule can have a solid edge in 8 tickers and be noise in the other 500. The "Reason" column says why each ticker landed in its tier.
| Strategy | TF | Ticker | Tier | Trades | WR | PF | PSR | Reason |
|---|
Portfolio Lab — the Fundamental Law of Active Management
Grinold & Kahn: Information Ratio ≈ IC × √breadth. You don't need one genius GOLD strategy — combine many strategies with a small but genuine edge, weakly correlated, and the basket beats any of them alone. This takes the best non-rejected strategy of each ticker, re-simulates it, and combines them weighted by inverse volatility (equal risk per strategy, so a volatile name can't dominate). A basket of BRONZEs can be, together, gold-grade.
—
| Ticker | TF | Strategy | Premium | Tier | Weight | Single Sharpe |
|---|
Permutation Test — is the edge real, or luck? (Aronson)
Monte-Carlo permutation test (David Aronson). For each top strategy it keeps the real price series but shuffles the entry timing — same number of entries, random bars — hundreds of times, and measures how often pure luck matches the strategy. The p-value is that fraction: p ≤ 0.05 means the entry timing has genuine skill; a high p-value means entering at random does just as well — the trigger adds nothing. An independent third lens, alongside the DSR and CPCV/PBO.
—
| Verdict | Ticker | TF | Strategy | Trades | Real / trade | Random median | p-value |
|---|
Carver Forecast — continuous signals + volatility targeting
Robert Carver's framework. Instead of on/off signals, each rule (EWMAC trend at three speeds + breakout) produces a continuous forecast from −20 (strong down) to +20 (strong up). They're combined per asset, and the suggested position scales with the forecast and the inverse of volatility — equal risk per position, so a volatile name can't dominate. A parallel analysis layer: it shows what a Carver-style trend system would hold, it doesn't execute.
—
| Dir | Ticker | Forecast | EWMAC 16/64 | EWMAC 32/128 | EWMAC 64/256 | Breakout | Ann vol | Weight |
|---|
Horizon Champions — the best rod of each category
Every non-rejected strategy classified by its design horizon — how long it holds a trade (timeframe × exit timeout). SHORT, MEDIUM and LONG compete in separate categories, so a great short-term strategy isn't buried under the long-term ones. And since short- and long-horizon edges are weakly correlated, holding the champion of each is genuine diversification.
PineScript inbox — paste a strategy to evaluate it across the universe
Paste your PineScript code below and hit Save. The server stores it to
agents/pending_pinescripts/ with a timestamp. Translation to Python is still
manual: after saving, paste the same code in your chat with Claude — I'll translate it
into agents/custom_strategies.py. After deploying, the Custom Lab (in the Strategy
Lab Swing page) re-evaluates all custom strategies across every ticker × timeframe (incl. scalping
30m / 15m / 5m) and produces the top-15 ticker breakdown you'll see in the Per-asset table below.
Strategy Lab Scalping — 30m / 15m / 5m, net of transaction costs
Same engine as the swing Strategy Lab (trigger + filter + exit, scored on TRADES, Deflated
Sharpe Ratio, walk-forward out-of-sample), but on scalping timeframes and with a
mandatory transaction-cost model: every trade pays a round-trip cost
(spread + slippage) before Sharpe / DSR / tiers are computed — at 5min that cost decides whether
a strategy wins or loses, so a cost-free backtest would be pure fiction.
Honest caveat: yfinance only keeps ~60 days of intraday data = one market
regime; treat these as provisional — the forward tracker validates over time. Generate with
python agents/agente_strategy_lab_scalping.py.
—
| Tier | Ticker | TF | Strategy | Sharpe | DSR | OOS | $10k → | Return | Trades | Win rate |
|---|
| Class | Fund | Manager | Index | ISIN | TER % | Return | Type | Acc/Dist | Platforms | Transfer | Notes |
|---|
| Fund | ISIN | % | TER |
|---|---|---|---|
| Vanguard Global Stock Index (All Cap, incl. emerging) | IE00B03HCZ61 | 100% | 0.18 |
| Weighted TER | 0.18% | ||
| Fund | ISIN | % | TER |
|---|---|---|---|
| Vanguard Global Stock Index (All Cap) | IE00B03HCZ61 | 40% | 0.18 |
| Vanguard European Stock Index | IE0007987708 | 15% | 0.12 |
| iShares US Equity Index | IE000N4ZYX28 | 15% | 0.05 |
| Vanguard Emerging Markets Stock Index | IE0031786696 | 10% | 0.23 |
| Vanguard Japan Stock Index | IE0007286036 | 10% | 0.16 |
| iShares Developed Real Estate Index | IE00B83YJG36 | 10% | 0.22 |
| Weighted TER | ≈ 0.16% | ||
fuera_de_universo_alpaca o por PAUSE_NEW_TRADES. Se sigue mostrando todo lo demas
(incluido ya_existe_posicion_abierta, que es informacion util).
Sizing engine (Thorp Kelly + Carver Vol Target)
Each trade is sized via fractional Kelly using prob_win from Meta-Labeling and the TP/SL payoff ratio of the Triple Barrier (default b=2). The aggregate portfolio is then scaled to a target annual volatility (Carver). HRP redistributes between correlated assets when 2+ signals are active.
—
Daily plan
Live signals today where Meta-Labeling predicted prob_win ≥ 0.55. Current mode: read_only. Two buttons below: the first only simulates, the second sends the orders to Alpaca paper.
| Ticker | Universe | Side | Regime | RSI | Momentum 20d | Meta prob | Note |
|---|
Promoted strategies bridge — what's live today
For each promoted strategy (the SILVERs/GOLDs you activated with
Promote), the bridge recompiles the same trigger × regime filter
on the latest bar of its timeframe and checks whether the entry conditions
fire today. If they do, the entry is merged into the Daily
plan above so the Executor can size it and send the order. If they don't,
you see exactly why not per strategy. This is the only feed of
promoted-strategy signals into Alpaca paper.
—
Tarda 10-20 min. Para automatizar promociones intraday (5m/15m/30m), configura un cron en n8n
que llame a POST /api/bridge-intraday?mode=execute cada 15-30 min en horario US market
(13:30-20:00 UTC L-V). El daily cron de las 12:00 UTC sigue corriendo el pipeline completo aparte.
| Ticker | TF | Strategy | Live? | Trigger | Regime | RSI 14 | Mom 20 | Last bar | Why |
|---|
Executor actions (history)
Table of everything the agent has decided in each execution: planned, simulated, sent, rejected or skipped. Useful as an audit.
| Date | Mode | Ticker | Side | Qty | Price | Notional | Prob | Status | Notes |
|---|
Open positions
Cada fila lleva un boton Close que cierra solo esa posicion (sell market) sin tocar las demas. Util cuando tienes varias abiertas y quieres salir de una sin esperar al Close Monitor.
| Ticker | Side | Quantity | Entry | Entry time | Actual | Market value | P&L | P&L % | Action |
|---|
Trade Journal — decision narrative
Every Executor decision (executed, vetoed, skipped, planned) appears here with a natural-language explanation. The verdict of the qualitative Judge shows as a tag: APPROVE (green), CAUTION (amber) or VETO (red). If Ollama is running, the narratives are written by the local model; otherwise a Python template with the relevant data.
Close Monitor (live Triple Barrier)
For each open position, Leonex computes its take-profit (2σ), stop-loss (1σ) and timeout (5 days) at the moment of entry. This monitor compares the current price against those limits and closes automatically when one is hit. Without it, positions stay open forever.
| Ticker | Entry | Current | Return | TP target | SL target | Days / timeout | Decision |
|---|
Recent Orders
| Ticker | Side | Type | Quantity | Filled | Avg price | Status | Created |
|---|
Setup recordatorio (Alpaca paper en EasyPanel)
1. Cuenta gratuita en alpaca.markets → "Paper Trading" (no live).
2. API Keys → Generate: anota la Key ID y la Secret.
3. EasyPanel → app leonex → Environment:
añade ALPACA_API_KEY y ALPACA_API_SECRET (o
ALPACA_SECRET_KEY; el cliente acepta cualquiera de los dos).
4. Save y redeploya el contenedor.
5. En este dashboard, pulsa Diagnose Alpaca connection y verifica
veredict OK - all green. Si falla, el JSON del diagnóstico te dice exactamente qué env var falta o qué error devuelve Alpaca.
Automated Fundamental Analysis
EDGAR Extraction (XBRL) y Text Analysis (LLM Ollama) a
Valuation Templates. Generated by agent_fundamental.py
| Ticker | Original Template | Status | Output File |
|---|
Agents Plan
| Agent | Inspiration | Responsibility | Status |
|---|
Leonex pillars
Free Books and public domain
Filtered by category. The Access column indicates whether the source is 100% legal and free, partial (preview or individual chapters) or requires purchase. For commercial books we only link to the publisher; unauthorized copies on open archives are outside Leonex's scope.
| Category | Title | Author | Access | Why it matters | Link |
|---|
Key Figures of the Leonex system
Each figure contributes a concrete piece to the architecture. It is not a list of celebrities: it is the virtual team that inspires each agent of the system.
The 5 pillars of Lopez de Prado + Causal Factor Investing
First the five classic pillars (AFML 2018) and then the new causality layer presented in the ADIA 2026 interview. Each one applies directly to a concrete Leonex module.
6 statistical concepts for the quantitative swing trader
The minimum needed for the rest of the system to make sense. Numbered by dependency: 1 and 2 are the basis of everything, 4 is the one most people skip.
External sources ranking
A critical filter to avoid wasting time. Each source gets a score from 1 to 10 and the decisive columns are What enters the system and What is discarded.
| Source | Score | Verdict | What enters Leonex | What is discarded |
|---|
5-phase study plan (12-18 months)
An honest roadmap with realistic effort. Assumes ~10-15 h/week. Most ideas do not pass the backtest; of those that do, half do not pass rigorous validation. That filtering is the process, not a failure.
| Phase | Basis | Application in Leonex | Status |
|---|
Automation (n8n cron en EasyPanel)
Leonex corre en EasyPanel. La automatización ya NO es Windows Task Scheduler — eso pertenece a la
época del PC local. Hoy los disparos del pipeline los hace n8n golpeando los
endpoints HTTP del servidor (leonex_server.py) según un cron centralizado.
POST /api/refresh-async (fire-and-forget)
POST /api/bridge-intraday?mode=execute
durante US open
botón "Refresh trades only" del dashboard (~30s)
anti-flicker; YELLOW preserva pausa previa
Endpoints útiles del servidor
POST /api/refresh-async — pipeline diario completo
POST /api/bridge-intraday?mode=execute — bridge intradía (5m/15m/30m)
POST /api/refresh-trades-only — solo executor + close monitor (~30s)
POST /api/promote?ticker=X&strategy=...&timeframe=... — promueve estrategia
GET /api/diagnose-alpaca — diagnóstico de conexión Alpaca
POST /api/close-position?ticker=X — cierra una posición concreta
El cron de n8n se configura desde el workflow editor. Si añades un endpoint nuevo, recuerda actualizar el workflow correspondiente en n8n.
Working commands
Risk Monitor dispara RED si el rolling DD supera este umbral.
Volatilidad anualizada objetivo del sizing (Carver).
Half-Kelly aplicado al edge estimado por estrategia (Thorp).
Leído de paper_report.json (auto_approve + simulated_only).
Exposure per Class
How Leonex works — the data flow
From raw market data to a paper trade, and the research labs that run alongside. Everything is rebuilt by the pipeline; each box below is an agent.
Green = the core daily pipeline that ends in a paper order. Purple/blue = research labs that score and combine strategies. Amber = health checks. The labs and monitors never block the pipeline — they inform your decisions.
What each page does
| Page | What it shows / what it's for |
|---|---|
| Overview | Command center: tracked assets, top candidates, and the Data Coverage panel — your daily check that the data loaded fully. |
| Charts | Normalized price evolution (base 100) to compare momentum, volatility and rotation across assets. |
| Scanner | Tactical ranking of the universe to spot opportunities before they reach the validation pipeline. |
| Regime | Market regime per asset — trend vs range, from ADX/ATR/moving averages. Tells you when the environment is wrong for a strategy. |
| Signals | The core trading pipeline: adaptive signals, Triple Barrier labels, the Causal graph, Meta-Labeling (ML), Validation and CPCV/PBO. |
| Strategy Lab — Swing | Best swing strategies per asset (1d/4h/1h), plus the Portfolio Lab, Permutation Test, Carver forecasts, Custom strategies and the forward Tracker. |
| Strategy Lab — Scalping | Scalping strategies on 30m/15m/5m, net of transaction cost, with the "BRONZE one step from SILVER" view. |
| Paper Trading | Alpaca paper connection (risk-free): the daily plan filtered by Meta-Labeling, position sizing, and the trade journal. |
| Fundamentals | Fundamental valuation from financial data (module under construction). |
| Funds | Index-fund layer — a tax-efficient way to rotate exposure. |
| Agents | The AI agents that make up the system and their operational role. |
| Library | Reference material — key authors and an applied study plan. |
| Code | Scripts, commands and upcoming modules. |
| Risk | Risk limits, drawdown, sizing and the Risk Monitor — system survival. |
| Logs | Technical status and the commands to feed the dashboard. |
| Guide | This page — the data-flow infographic and the glossary. |
Glossary
The terms that show up across Leonex, in plain language.
| Term | Meaning |
|---|---|
| Sharpe ratio | Return per unit of risk (volatility). Higher = better risk-adjusted return. |
| PSR — Probabilistic Sharpe Ratio | Probability the true Sharpe is genuinely above 0, given the sample size and non-normal returns. Used when there is a single strategy. |
| DSR — Deflated Sharpe Ratio | PSR after discounting multiple testing: if you tried hundreds of strategies, the best looks great by luck. DSR deflates that. The anti-overfitting backbone (López de Prado). |
| Triple Barrier | Each entry opens a trade closed by one of three barriers: take-profit, stop-loss, or a time limit. Turns signals into discrete, scoreable trades. |
| Walk-forward / OOS | Out-of-sample testing: evaluate the strategy on data it was never fitted on. An edge that only works in-sample is overfitting. |
| CPCV | Combinatorial Purged Cross-Validation — many train/test splits to stress-test a strategy against luck. |
| PBO | Probability of Backtest Overfitting — the odds the backtest's winner is a fluke. |
| Tier — GOLD / SILVER / BRONZE / REJECTED | Quality grade of a strategy from its DSR, trade count and profit factor. GOLD = high confidence; BRONZE = positive edge but not high-confidence; REJECTED = no edge. |
| Trigger | The entry event — RSI oversold, MACD cross, volume-confirmed breakout, etc. |
| Regime filter | A context mask: only allow the entry when the market regime fits (strong uptrend, range-bound, pullback…). A breakout in a trend is not the same trade as a breakout in a range. |
| Exit config | The take-profit / stop-loss / timeout settings that close a trade. |
| Regime | The market environment — trend vs range — measured with ADX, ATR and moving averages. |
| Meta-Labeling | A secondary ML model that decides whether to actually take each trade the primary signal flagged (López de Prado). |
| HRP — Hierarchical Risk Parity | Sizing a portfolio by risk contribution and correlation structure instead of by raw capital. |
| Kelly criterion | The bet size that maximises long-term compounded growth (Thorp). |
| Transaction cost | Commission + spread + slippage subtracted from every trade. Modelled on Interactive Brokers Pro (~0.03% round-trip on liquid names). |
| Profit factor | Gross wins ÷ gross losses. Above 1 means profitable overall. |
| Expectancy | The average return per trade. |
| Max drawdown | The worst peak-to-trough fall of the equity curve. |
| Permutation test / p-value | Shuffle the entry timing at random hundreds of times; the p-value is how often pure luck matches the strategy. p ≤ 0.05 = genuine timing skill (Aronson). |
| EWMAC | Exponentially Weighted Moving Average Crossover — Carver's trend-following rule. |
| Forecast (Carver) | A continuous signal from −20 (strong down) to +20 (strong up). The strength matters, not just on/off. |
| Volatility targeting | Sizing each position so it contributes equal risk — a volatile asset gets a smaller position. |
| Breadth / Fundamental Law | Grinold & Kahn: Information Ratio ≈ skill × √breadth. Many small, independent, weakly-positive bets beat one big one. |
| Return premium (Ilmanen) | The economic reason a strategy earns money — momentum, mean-reversion, reversal. No clear premium = more likely a data-mining fluke. |
| Forward tracking | Testing a promoted strategy on brand-new data going forward — the truest out-of-sample test. |
| Drift | When a strategy's edge decays because the market regime changed. |