How-to guide · Backtesting & Walk-Forward Testing

How to Set Up a Walk-Forward Backtest

Choose windows, split in-sample from out-of-sample, apply the real cost model, then read the in-sample to out-of-sample gap without flinching.

Published June 4, 2026 · Primary topic: set up a walk-forward backtest

← Back to the Backtesting & Walk-Forward Testing hub

Setting up a walk-forward backtest is less about software and more about discipline: keeping the data the strategy tunes on strictly separate from the data it is judged on. Done right, the result is an honest estimate of how a strategy behaves on conditions it has never seen. Done loosely, you are back to grading a strategy on its own homework.

Before you start

Decide three things up front: the pair and timeframe you are testing, the length of your in-sample (tuning) and out-of-sample (validation) windows, and the cost model you will charge. Charging realistic costs from the first run keeps you honest — a strategy that only works at zero fees is not worth tuning.

Steps

  1. Split the history into windows. Divide your data into successive in-sample and out-of-sample windows that never overlap. Each in-sample window is for tuning; the following window is for validation only.
  2. Tune on in-sample only. Optimise parameters using only the in-sample window, so the next window stays genuinely unseen. Resist the urge to peek at validation results while tuning.
  3. Apply the realistic cost model. Charge fees, spread, and a slippage buffer inside the test so the strategy must beat its full friction, not just predict direction.
  4. Validate and roll forward. Score the strategy on the unseen window, then roll both windows forward and repeat across every fold until you have covered the history.
  5. Read the gap. A wide in-sample to out-of-sample gap is the signature of overfitting. Treat a passing run as permission to paper trade — never as permission to go live.

What a good result actually means

A clean walk-forward run with costs included and a narrow gap is a meaningful signal — but it is still a simulation. Real markets diverge from any model, and a passing backtest does not guarantee future results. That is exactly why the paper-trading gate exists between a tested strategy and live funds.

For the theory behind this process, read walk-forward testing explained. To understand the cost model you are applying, see the cost-beating rule for trading signals. When a strategy passes, the next stop is the Kraken API trading bot — in paper mode first.

Important

This is not investment advice.

GreatDane Trades is an education, backtesting, and trading automation platform. Nothing on this site is financial advice. Results are simulated. Backtests do not guarantee future results. Markets can diverge from simulations. Trading cryptocurrencies involves substantial risk including the total loss of capital. Paper trading should come before live trading. Users are responsible for their own trades.

Read the full risk disclaimer →

More in Backtesting & Walk-Forward Testing

Closely related guides in this topic cluster.

See every guide in this cluster on the hub: Backtesting & Walk-Forward Testing.

Explore the other pillars

Put the discipline into practice — in paper first.

Start in paper mode, validate with walk-forward backtests, and let the risk engine hold the line. No real capital is at risk until you decide to connect Kraken.

No profit promises. Paper trading by default.