Walk-Forward Optimization · BTC + ETH · Paper-Traded

WALK-FORWARD EDGE

A research framework that fits strategies on rolling in-sample windows and validates every signal against out-of-sample data it has never seen. No curve-fit. No look-ahead. No narrative drift — only edges that survive the next candle.

OOS Sharpe
1.20
Max Drawdown
-28.0%
CAGR (OOS)
44.2%
Cumulative Return
144.5

A backtest is a story.
A walk-forward is a stress test.

Most crypto backtests are theatre: parameters tuned on the same data they are then evaluated on, look-ahead leakage baked into features, slippage assumed away. The walk-forward protocol exists to make the backtest honest.

NAIVE BACKTEST

Fit on full history, evaluate on full history

  • Parameters tuned on the entire dataset
  • Evaluator sees the same data as the fitter
  • Look-ahead leakage in feature computation
  • Slippage, fees, funding routinely ignored
  • Reported Sharpe is in-sample Sharpe
Reported Sharpe: flattering — and almost certainly a lie.
WALK-FORWARD

Fit forward, evaluate forward

  • Parameters tuned only on the training window
  • Evaluator sees data the fitter never touched
  • Look-ahead explicitly forbidden in feature spec
  • Slippage, fees, funding accrued per bar
  • Reported Sharpe is out-of-sample Sharpe
Sharpe: 1.20 — and defensible.

Train, test,
roll, repeat.

Each week the system scores a fixed zoo of 24 configurations on the trailing 30-day window, trades the average of the top 3 out-of-sample for the next week, then rolls forward and re-ranks. OOS returns aggregate into the only equity curve that matters — the one built from weeks the selection never saw when it was chosen.

STEP 01 — SCORE

Rank the zoo on the trailing window

Every Monday 00:00 UTC, each coin's fixed zoo of 24 configurations (trend EMA crosses, Donchian breakouts, mean-reversion, and cash) is ranked by Sharpe over the trailing 30-day window of 4h bars — net of costs and funding.

┌───────────────────────┐ │ 24 configs × 30 days │ score by Sharpe └───────────────────────┘
STEP 02 — SELECT TOP 3

Trade the top-3 average

The book trades the equal-weight average of the top 3 ranked configurations for the coming week — a plateau, not the single winner, to blunt the winner's curse. If nothing scores positive, the book sits in cash.

rank #1 #2 #3 → equal-weight basket (else → CASH)
STEP 03 — SIZE & HOLD

Size to a volatility target, hold one week

Position size targets 50% annualized volatility with a 1.5x cap. The selection is frozen and held out-of-sample for the week; every fill, cost (0.15%/side), and real Binance funding event is recorded against it.

┌──────────────┬────────────┐ │ SELECT (Mon) │ HOLD 1 wk │ out of sample └──────────────┴────────────┘
STEP 04 — ROLL & AGGREGATE

Advance a week, refit, stitch

The next Monday the window rolls forward and the zoo is re-ranked on fresh data. The contiguous sequence of weekly out-of-sample returns concatenates into the equity curve — the only performance record reported.

[wk₁][wk₂][wk₃][wk₄] → EQUITY CURVE

Four layers, one signal path.

Every position passes through signal generation, risk overlay, execution simulation, and validation. No layer trusts the layer before it; each one re-checks the assumptions it needs to operate.

01

Adaptive Signal Selection

Trades the equal-weight average of the top 3 configurations from a fixed zoo of 24 configs per coin (trend crosses, breakouts, mean-reversion, and cash). Configurations are ranked by Sharpe over a trailing 30-day window. If nothing scores positive, the book sits in cash.

24-config zoo
02

Execution & Sizing

Enforces a 50% annualized volatility target with a 1.5x cap for position sizing. Incorporates realistic frictions: 0.15% transaction costs per side on every position change, and real Binance funding charged.

50% vol target (1.5x cap)
03

Walk-Forward Protocol

Utilizes 4h bars with a weekly refit every Monday 00:00 UTC. The trailing window is 30 days for scoring, meaning the parameters update dynamically without look-ahead or predictive modeling. It adapts to the market instead of predicting it.

Weekly Monday refit
04

Two-Asset Universe

Trades BTC and ETH only, 50/50 split, each asset managed in its own independent book. Secondary assets and complex features (e.g. sentiment) were explicitly rejected during research.

BTC & ETH only

Numbers the model never saw.

Every metric below is computed on the contiguous out-of-sample equity curve. In-sample numbers are kept in the diagnostic logs — never on this page. Open the interactive dashboard for the full equity curve, drawdown profile, and per-asset attribution.

Sharpe Ratio
1.20
OOS · 1.20 +/- 0.64 SE
Max Drawdown
-28.0%
Peak-to-trough · OOS
CAGR
44.2%
Compound annual · OOS
Full Period Return
144.5%
OOS · 2024-01-01 to 2026-06-10
Hold BTC Return
46.0%
Continuous buy & hold
Hold ETH Return
-27.8%
Continuous buy & hold

Full equity curve, drawdown, and per-asset attribution

The interactive dashboard exposes the full OOS equity curve, rolling drawdown, monthly returns heatmap, and per-asset contribution.

Open dashboard

Reproducible from
a single command.

~/walk-forward-crypto
# Fetch data, fit, walk-forward, render
python -m wf.main \
    --universe      "BTC,ETH" \
    --train-window  30d \
    --test-window   7d \
    --report        "./docs/interactive/dashboard.html"

# → Walk-forward weekly refit completed
# → Full period: Sharpe 1.20 +/- 0.64 · MaxDD -28.0% · CAGR +44.2%/yr
# → Dashboard written to docs/interactive/dashboard.html
Python 3.11
Core runtime, typed end-to-end
pandas · NumPy
Vectorised signal + return math
ccxt
Exchange connectivity, OHLCV sync
Plotly
Interactive equity + drawdown rendering

Friction & Execution Modeling

Unlike backtests that ignore execution realities, the walk-forward validation framework enforces strict penalties. Every parameter combination is evaluated under realistic transaction friction, execution slippage, and funding cost dynamics.

01 — Volatility Target

Target 50% annualized volatility with a 1.5x cap

Position size dynamically targets 50% annualized volatility, capped at 1.5x representing modest simulated leverage to scale exposure safely.

02 — No Drawdown Brakes

Drawdown brakes were explicitly rejected

Research showed drawdown brakes destroy returns: with a kill switch, 2025 returned -12.6% vs +41.0% without. Survival relies on config scoring instead.

03 — No Market Classifiers

Direct configuration weighting

The system does not predict market states using classifiers. It dynamically adapts by scoring a zoo of 24 configurations over the trailing 30-day window.

04 — Transaction Costs

0.15% per side transaction costs and real funding

Simulation model charges 0.15% per side on every position change and real Binance funding rates on perps, evaluating realistic execution frictions.

05 — Ensemble averaging

Trades equal-weight average of top 3 configs

Config weighting averages the top 3 configurations to reduce winner's-curse. If no configuration has a positive score, the book sits in cash.

06 — Walk-Forward protocol

Weekly refit on 4h bars with 30d window

Window optimization runs out-of-sample on 4h bars with a weekly refit every Monday 00:00 UTC, preventing overfitting and forward leakage.