Configuration

The left panel of the WFA panel contains all configuration: market data, walk-forward window settings, parameter sweeps, and presets.

Market Configuration

WFA shares the same market data fields as the Backtesting component. These define what historical data to download and use for all fold windows.

FieldTypeDescription
MarketselectData provider / exchange (e.g. stocks, forex, crypto).
SymbolstringTicker symbol such as AAPL, BTCUSD, EURUSD.
TimespanselectBar resolution: second, minute, hour, day, week, or month.
MultipliernumberTimespan multiplier. E.g. multiplier=5 with timespan=minute → 5-minute bars.
FromdateStart date for historical data fetch (ISO format).
TodateEnd date for historical data fetch (ISO format).
LimitnumberMaximum number of bars to fetch. Acts as a cap after date filtering.
Important:Data is fetched once and held in memory for the full WFA run. The total bar count determines how many folds can fit. Ensure your date range is large enough to accommodate at least one complete fold (trainBars + testBars).

Market Presets

Market configurations can be saved as named presets and reloaded at any time. Presets are persisted in localStorage under the key traderoid_wfa_history_presets.

Save
Type a name in the preset input and press Enter or click Save. The current market configuration is stored.
Load
Click a preset name in the dropdown to restore that market configuration instantly.
Delete
Click the ✕ button next to a preset to remove it from storage.

WFA Window Settings

These settings define the fold window geometry and selection logic. The default values are trainBars: 500, testBars: 100, stepBars: 100, mode: rolling, selectionMetric: netPnL.

SettingDefaultDescription
trainBars500Number of bars in the training (in-sample) window. Must be large enough to produce statistically meaningful backtest results.
testBars100Number of bars in the test (out-of-sample) window. Shorter windows give more folds but noisier OOS estimates.
stepBars100 (= testBars)How many bars to advance between folds. Usually equals testBars for non-overlapping OOS windows. Smaller step creates overlapping folds.
moderollingrolling: fixed-size training window that shifts. anchored: training always starts at bar 0 and grows.
selectionMetricnetPnLWhich statistic to rank parameter combos by during IS optimisation: netPnL, profitFactor, winRate, totalReturn, or maxDrawdown (inverted).

Selection Metrics

During the in-sample sweep, every parameter combination is ranked by the selected metric. The combination with the highest rank becomes the "best params" for that fold.

MetricLabelSelection Logic
netPnLNet P&LHighest net profit and loss value.
profitFactorProfit FactorHighest gross profit / gross loss ratio. Infinity is capped at 1e9.
winRateWin RateHighest percentage of winning trades.
totalReturnTotal ReturnHighest absolute return value.
maxDrawdownMin DrawdownLowest (best) maximum drawdown — metric is negated, so the combo with the smallest drawdown wins.

Fold Count Preview

The configuration panel shows a live preview of the estimated fold count. The exact formula used by computeFoldWindows():

// Rolling mode
folds = floor( (totalBars - trainBars - testBars) / stepBars ) + 1
// Only folds where testEnd < totalBars are kept
Example: 2000 bars, train=500, test=100, step=100
(2000 - 500 - 100) / 100 + 1 = 15 folds
Total combos = 15 × parameter_combos
Total Runs
totalRuns = foldCount × paramCombos
Each IS sweep + 1 OOS single run per fold. The config panel shows both estimated folds and total run count in real-time.

Parameter Sweeps

The sweep section defines which parameters to optimise and over what range. This mirrors the Backtesting parameter sweep, but is applied independently on each fold's training window.

Auto-Detection

Click Detect to scan the currently compiled strategy graph for numeric parameters. Each detected parameter shows its node name, param name, and current value.

Add All Params

The Add All button adds every detected parameter to the sweep list at once. Default ranges are set automatically: min = 50% of current value, max = 200% of current value, step = 25% of current value (all rounded).

Sweep Row Fields

FieldDescription
ParameterSelect from detected params (varName.paramName). e.g. sma.period
MinMinimum value for the sweep range (inclusive).
MaxMaximum value for the sweep range (inclusive).
StepIncrement between values. Combo count = floor((max-min)/step) + 1.
Combos (info)Live display showing how many combinations this row produces.
NumField commit behavior:Numeric fields use a draft pattern — changes are only committed on blur or Enter. This prevents partial typing from immediately triggering fold recalculations.

Sweep Presets

The full sweep configuration (all rows with their min/max/step values) can be saved as a named preset. Stored in localStorage under traderoid_wfa_sweep_presets.

Save
Name the sweep configuration and press Save. The current sweep rows are snapshotted.
Load
Click a saved preset to restore its rows, completely replacing the current sweep.
Delete
Remove a preset with the ✕ button. Does not affect current sweep rows.

Worker Count

WFA reuses the global worker count from the Backtesting Settings store. The setting is shared — changing it in Backtesting affects WFA and vice versa.

localStorage key: traderoid_backtesting_settings
The worker count controls how many Web Workers run parameter sweeps in parallel during the in-sample phase of each fold. Higher counts speed up optimisation but increase memory pressure.

Run Progress

During a WFA run the configuration panel shows a two-level progress indicator:

Outer Progress
Fold X / N — tracks how many complete folds (IS + OOS) have finished. Percentage bar fills from left to right.
Inner Progress
Phase label (Optimizing or Validating) + combo X / N within the current fold's IS sweep.
Partial Results
Completed folds appear in the fold table as they finish — you do not need to wait for the entire run.
Stop Button
Clicking Stop cancels the current fold's sweep and aborts the fetch if data is still downloading. Partial results already in the table are preserved.