Trading system methodology
Not a collection of bots but a system: every edge is proven by walk-forward, risk is normalised against equity, and both execution and evolution are formalised. Seven layers, each tied to a real engine module.
implemented in code
the core — do not touch
development priority
01
Philosophy
Core Thesis
We do not predict price — we exploit measurable inefficiencies and trade only those that survived out of sample. Four basics: reversion to levels, ATR as the real volatility behind adaptive stops, a regime and trend filter against false entries, and a profit lock that banks the edge on a pullback.
In the system
The thesis carries the edge type: rsi2_mr/ibs = mean reversion, keltner_bo = breakout, tom = seasonality, wick_rej = wick fade.
Generation
edge-dsl.js — the recipe constructor cx_<trigger>__<filter>: hypothesis → automatic validation.
coreRule number one: no edge goes into trading without a proven thesis on unseen data.
02
Mathematical model
Quant Backbone
The formalised calculation core — what turns rules into a testable algorithm.
ATR (Wilder, p=14) — the measure of volatilityATRᵢ = (ATRᵢ₋₁·(p−1) + TRᵢ) / p, TR = max(H−L, |H−Cₚᵣₑᵥ|, |L−Cₚᵣₑᵥ|)
Risk sizing — size scales with equity (compounding)units = (equity · riskPct) / (ATR · slM · pip) → the ATR stop equals exactly riskPct × equity
pfLow — the lower bound of the profit factor (protection against luck)pfLow = the 10th percentile from 200 bootstrap replays of the trades
Walk-forwardIn-sample = the first 70% · out-of-sample = the last 30% · the edge must hold out of sample
Fixed
ATR=14, split=0.7, bootstrap B=200, costs = spread × 1.5 + swap. The constants of honesty.
Adaptive
Target and stop in ATR units, size from equity, and a ratchet chosen for the specific edge.
03
Market regimes
Market Regimes
The same edge thrives in one regime and dies in another. The system classifies the regime and gates entry accordingly.
Classifier
regime.js → TREND · RANGE · HIGHVOL · NEUTRAL by ADX, efficiency ratio and ATR percentile.
Alignment
signal-ensemble.js — fit(family, regime): mean-reversion edges require RANGE, breakout and trend edges require TREND, and mean reversion is cut in HIGHVOL.
implementedRegime gate woven into the executors for crypto, Kraken and equities: entry is skipped if fit < 0.7 (the regime opposes the edge family).
04
Risk doctrine
Risk Doctrine
Size from equity, stop from ATR, limits on top, and a status multiplier reflecting confidence in the edge.
Risk per trade
riskPct = 1% equity ÷ ATR stop. A more volatile instrument automatically gets fewer units.
Position limit
MAX_CONCURRENT / MAX_POS — the ceiling on simultaneous trades.
Daily and weekly stop
risk-guard.js: −6% of equity in a day or −12% in a week stops new entries (open trades are still managed) plus drawdown-monitor.js.
Correlation limit
no stacking of correlated positions: if a candidate correlates strongly (|ρ|>0.7) with two or more open positions, entry is blocked.
Status multiplier
forward gate: confirmed = full size · probation = micro · rejected = skip.
Profit-lock
exits.js — break-even, chandelier, Donchian trail: they bank profit as the move develops.
implementedA single risk doctrine across every executor (risk-guard.js): a daily and weekly stop-loss and a hard correlation limit — crypto, Kraken, Alpaca, OANDA.
05
Execution protocol
Execution Protocol
What separates an idea from a system: strict entry conditions, a definition of a false signal, and automation.
Entry
Only on a newly closed bar (deduplicated by lastBar), signal ≠ 0, ATR above zero, and the regime gate passed.
False signal
A bar already acted on, no ATR, a regime opposing the edge, or a short on spot — all skipped.
Exit
ATR stop and target plus a ratchet (chand/be/donch/matrl) plus a 60-bar time stop.
Automation
cron */5 per venue; an edge's path: shadow → forward gate → live.
06
Performance metrics
Performance Framework
What makes a strategy provable. The lab computes for each edge:
pfLow
the lower bound of the profit factor (the primary ranking)
Profit Factor
gross profit divided by gross loss
Expectancy
net per trade in R
Sharpe
per-trade stability
Max Drawdown
in units of R
Win Rate
the share of winners
Max Consec Loss
the worst losing streak
Profit factor by regime
edge-stability across regimes
Stress test
the profit factor on high-volatility bars
the ROBUST thresholdPF_is ≥ 1.2 · PF_oos ≥ 1.1 · pfLow ≥ 1.0 · out-of-sample trades ≥ 20.
implementedEdge stability across regimes: the lab splits out-of-sample trades by the regime at entry and computes the profit factor in each — showing whether an edge holds broadly or only in one regime.
implementedStress test: each edge is run separately over high-volatility bars alone — revealing whether it loses money in a volatility shock or holds up (for example vortex21 at 0.79 is fragile, td9 at 6.6 is solid).
07
Improvement process
Evolution Path
What may be tuned, what must not be touched, and how a change reaches live trading.
Core (frozen)
the walk-forward gate, honest costs, the bootstrap lower bound and a minimum number of out-of-sample trades. Left alone.
Tuning
strategy_config.json (sliders in the account area): riskPct, minPfOos, maxConcurrent, target/stop and exit mode.
Testing a change
a new edge → the walk-forward lab → forward gate (live paper) → automatic promotion once confirmed.
Schedule
the crypto lab daily, the stock lab weekly, the forward gate continuously (edge_confirmed.json).
the adoption decisionAn edge reaches live automatically only — when the forward gate has confirmed it in real conditions. There is no “let's just try it” by hand.