Backtesting › Configuration

Configuration Panel

Set up what to test — markets, time ranges, and parameter sweep definitions

Overview

The Configuration Panel is the left panel of the Backtesting component. It has two tabs — Market and Parameters — and a fixed bottom strip with run controls.

Before starting a backtest, you define which markets to test on and which parameters to sweep over. The configuration panel is where both happen.

Bottom Control Strip

The bottom of the configuration panel always shows the run summary and controls, regardless of which tab is active:

Run Summary

Displays "X markets × Y param combos = Z runs" — the total number of backtest runs that will be executed. Updated live as you change sweep ranges.

Progress Bar

Shows progress during a sweep. In Turbo Mode this bar is updated via direct DOM manipulation (not React state) for maximum performance.

Run Button

Starts the backtest sweep. Grayed out while a test is already running or during market data fetching.

Stop Button

Cancels the current sweep immediately. Results accumulated so far remain in the Leaderboard and Heatmap.

Clear Button

Clears all results from the Leaderboard, Heatmap, and Equity Curve. Use before starting a fresh sweep.

⚡ Turbo Mode

Toggle that bypasses React re-renders during a sweep. Recommended for large sweeps (500+ combinations). Managed via imperative DOM refs.

Market Tab

The Market tab lets you configure one or more market datasets to run your strategy against. Testing on multiple markets simultaneously multiplies the total run count.

Market Configuration Fields

FieldTypeDescriptionDefault
symbolstringTicker symbol to fetch data for (e.g. AAPL, BTC, EUR/USD)AAPL
marketenumMarket type: stock, crypto, or forexstock
timespanenumBar interval: second, minute, hour, day, week, monthminute
multipliernumberBar size multiplier. multiplier=5, timespan=minute → 5-minute bars1
fromdateStart date for historical data (YYYY-MM-DD format)365 days ago
todateEnd date for historical data (YYYY-MM-DD format)today
limitnumberMaximum number of bars to fetch (prevents huge requests)5000

Multi-Market Sweep

You can add multiple market configurations. When multiple markets are defined, the strategy is tested on every market for every parameter combination:

Markets: [AAPL 1m, TSLA 1m, MSFT 1m]
Parameter combos: 20
Total runs: 3 × 20 = 60

Adding Markets

Click "Add Market" to append a new configuration. New configs are copied from the last existing config for convenience — just change the symbol.

Removing Markets

Click the × button on a market config to remove it. The first config cannot be removed (minimum one market required).

Expanding / Collapsing

Each market config is an expandable accordion. Click the header to expand/collapse the fields. Only the first config starts expanded by default.

Leaderboard Multi-Market

When results span multiple markets, the Leaderboard automatically shows a Market column. Each row in the leaderboard represents one parameter combination on one market.

Market Presets

Save your favourite market configurations as named presets. Presets are persisted in browser localStorage under the key traderoid_backtest_history_presets.

Saving a Preset

Type a name in the preset name field and click Save. The current market configuration is saved as a named preset.

Loading a Preset

Click the Presets button to see saved presets. Click a preset to load it, overwriting the current market config.

Parameters Tab

The Parameters tab is where you define which parameters to sweep and what range to test. Parameters are automatically detected from your compiled node graph.

Auto-Detection

Click Compile to detect all sweepable parameters from your graph. The engine decompiles your node graph into Slang source code, parses all commands, and extracts every numeric parameter that can be varied. Source-type nodes (STOCK, CRYPTO, FOREX) are excluded — only indicator and logic parameters are swept.

// Detected parameters example:
sma1.period
sma2.period
rsi.period
rsi.overbought
rsi.oversold

Adding Sweep Rows

After compiling, click Add Parameter to add a sweep row. Each sweep row represents one axis of the parameter space. The engine automatically selects an unused parameter for each new row.

FieldDescription
ParameterDropdown to select which parameter to sweep. Format: varName.paramName (e.g. sma1.period)
MinMinimum value for this parameter in the sweep range
MaxMaximum value for this parameter in the sweep range
StepIncrement between values. e.g. Min=5, Max=20, Step=5 → [5, 10, 15, 20]

Combo Count

Each sweep row contributes a set of values. The total combinations is the product of all row counts:

sma1.period: Min=5, Max=25, Step=5 → [5, 10, 15, 20, 25] = 5 values
sma2.period: Min=10, Max=50, Step=10 → [10, 20, 30, 40, 50] = 5 values
Total: 5 × 5 = 25 combinations

Number Input Behaviour

The Min, Max, and Step fields use a lazy commit pattern — values are only committed when you press Enter or when the field loses focus (blur). This prevents the combination count from recalculating on every keystroke while you type.

Invalid inputs (non-numeric) revert to the previous valid value automatically. Min and max bounds are also enforced on commit.

Parameter Presets

Save the entire set of sweep rows as a named preset for reuse. Presets are persisted in browser localStorage under the key traderoid_backtest_presets.

Save Preset

Type a name and click Save. All current sweep rows (with min/max/step) are saved under that name.

Load Preset

Open the Presets panel and click a preset name. The sweep rows are replaced with the saved values.

Delete Preset

Click the × button next to a preset in the presets list to permanently remove it.

Global Settings

Backtesting settings are persisted in localStorage under the key traderoid_backtest_settings.

SettingDefaultDescription
workerCountmin(CPU cores, 8)Number of parallel Web Workers. Automatically set to your CPU core count, capped at 8. Settings changes are broadcast via a CustomEvent so all open instances stay in sync.