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.
| Field | Type | Description |
|---|---|---|
| Market | select | Data provider / exchange (e.g. stocks, forex, crypto). |
| Symbol | string | Ticker symbol such as AAPL, BTCUSD, EURUSD. |
| Timespan | select | Bar resolution: second, minute, hour, day, week, or month. |
| Multiplier | number | Timespan multiplier. E.g. multiplier=5 with timespan=minute → 5-minute bars. |
| From | date | Start date for historical data fetch (ISO format). |
| To | date | End date for historical data fetch (ISO format). |
| Limit | number | Maximum number of bars to fetch. Acts as a cap after date filtering. |
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.
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.
| Setting | Default | Description |
|---|---|---|
| trainBars | 500 | Number of bars in the training (in-sample) window. Must be large enough to produce statistically meaningful backtest results. |
| testBars | 100 | Number of bars in the test (out-of-sample) window. Shorter windows give more folds but noisier OOS estimates. |
| stepBars | 100 (= testBars) | How many bars to advance between folds. Usually equals testBars for non-overlapping OOS windows. Smaller step creates overlapping folds. |
| mode | rolling | rolling: fixed-size training window that shifts. anchored: training always starts at bar 0 and grows. |
| selectionMetric | netPnL | Which 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.
| Metric | Label | Selection Logic |
|---|---|---|
| netPnL | Net P&L | Highest net profit and loss value. |
| profitFactor | Profit Factor | Highest gross profit / gross loss ratio. Infinity is capped at 1e9. |
| winRate | Win Rate | Highest percentage of winning trades. |
| totalReturn | Total Return | Highest absolute return value. |
| maxDrawdown | Min Drawdown | Lowest (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():
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
| Field | Description |
|---|---|
| Parameter | Select from detected params (varName.paramName). e.g. sma.period |
| Min | Minimum value for the sweep range (inclusive). |
| Max | Maximum value for the sweep range (inclusive). |
| Step | Increment between values. Combo count = floor((max-min)/step) + 1. |
| Combos (info) | Live display showing how many combinations this row produces. |
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.
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.
traderoid_backtesting_settingsRun Progress
During a WFA run the configuration panel shows a two-level progress indicator: