QQ 301, 6 min read
Parameter glossary
Every option and input a user can set for a backtest or a validation.
"Run option" means a key in the options object.
6.1 Run options (the options object)
| Name | Type | Default | Units | Meaning | Source |
|---|---|---|---|---|---|
capital | number > 0 | 100000 | account currency | Starting cash. initial_capital is accepted as a fallback name. | backtest/runner.py:368 |
commission_pct | number >= 0 | 0 | % of notional per side | Commission on each fill. | backtest/runner.py:377 |
slippage_bps | number >= 0 | 0 | bps of price per fill | Moves every fill against the trader. | backtest/runner.py:378 |
spread_bps | number >= 0 | 0 | bps of price per fill | Half the bid/ask spread. | backtest/runner.py:920 |
spread | "data" / "bps" / absent | absent | "data" reads the half-spread from bid and ask columns. | backtest/runner.py:890 | |
spread_data_scale | number >= 0 | 1 | multiple | Scales the data half-spread. | backtest/runner.py:921 |
slippage_model | "fixed" / "vol" / "sqrt_impact" | "fixed" | Which slippage model runs on top of slippage_bps. | backtest/runner.py:895 | |
slippage_k | number >= 0 | 0.1 | multiple of bar σ | Volatility slippage coefficient ("vol" only). | backtest/runner.py:949 |
slippage_vol_bars | whole number >= 2 | 20 | bars | Volatility window ("vol" only). | backtest/runner.py:950 |
impact_c | number >= 0 | 1.0 | coefficient | Square-root impact coefficient ("sqrt_impact" only). | backtest/runner.py:961 |
latency_bars | whole number >= 0 | 0 | bars | Fills N bars later, at that bar's open. | backtest/runner.py:910 |
financing_bps_annual | number (may be negative) | 0 | bps per year | Carry on notional held, both sides. | backtest/runner.py:914 |
financing_long_bps | number (may be negative) | financing_bps_annual | bps per year | Carry for longs. | backtest/runner.py:915 |
financing_short_bps | number (may be negative) | financing_bps_annual | bps per year | Carry for shorts. | backtest/runner.py:916 |
size_scale | number > 0 | 1 | multiple | Multiplies every explicit qty. | backtest/runner.py:917 |
from | date string or epoch | none | UTC date, or epoch seconds / ms | First bar to include. | backtest/runner.py:1573 |
to | date string or epoch | none | UTC date, or epoch seconds / ms | Last bar to include. | backtest/runner.py:1574 |
params | object name → value | {} | Values the script reads with params.get. | backtest/runner.py:388 | |
extended_stats | boolean | false | Adds stats.extended (3.5). | backtest/runner.py:420 | |
timeout | number > 0 | 120 | seconds | Per-run deadline. | backtest/runner.py:386 |
Environment variable: QQT_BACKTEST_TIMEOUT, default 120, seconds
(backtest/runner.py:127).
6.2 Request inputs (/api/backtest and its variants)
| Name | Applies to | Type | Default | Units | Meaning | Source |
|---|---|---|---|---|---|---|
engine | all | string | "python" | Backtest engine. | engine/server.py:495 | |
provider | all | string | required | Where candles come from (userdata, backend). | engine/server.py:496 | |
symbol | all | string | required | Dataset or instrument. | engine/server.py:497 | |
timeframe | all | string | "1h" | Bar size. | engine/server.py:498 | |
script | all | string | required | The strategy source. | engine/server.py:499 | |
limit | all | integer | 0 | bars | 0 = every bar for a library dataset; remote providers are capped at 100,000. A positive value caps the load (maximum 1,000,000). | engine/server.py:502, engine/server.py:1469-1474 |
options | all | object | {} | Run options (6.1). | engine/server.py:505 | |
datasets | all | list of names | [] | Side datasets to attach explicitly. | engine/server.py:507 | |
runs | Monte Carlo, validate | integer | 1000 | paths | Clamped to 1–100,000. | engine/server.py:511, engine/server.py:533, engine/server.py:1537 |
seed | Monte Carlo, validate | integer | 42 | Seed for every random draw. Must be >= 0 for the institutional suite. | engine/server.py:512, engine/server.py:534, backtest/validation.py:178-181 | |
params | walk-forward, validate | object name → spec | {} | Grid: "lo:hi:step", "a,b,c" or a single value. | engine/server.py:517, engine/server.py:529, backtest/research.py:236 | |
folds | walk-forward, validate | integer >= 1 | 4 | Number of test windows. | engine/server.py:518, engine/server.py:530 | |
train | walk-forward, validate | number in (0, 1) | 0.7 | share | Training share within each fold. | engine/server.py:519, engine/server.py:531 |
metric | walk-forward, validate | string | "netProfit" | netProfit, profitFactor, winRate, avgTrade (and sharpeRatio for the sensitivity grid only). | engine/server.py:520, engine/server.py:532, backtest/runner.py:1293, backtest/runner.py:1388 | |
checks | validate | list | ["baseline"] | Any of baseline, walkforward, montecarlo, costs, sensitivity, dsr. | engine/server.py:526, backtest/validation.py:51 | |
cost_multipliers | validate | list of 1–10 numbers >= 0 | [1, 2, 3] | multiples | Cost stress levels. | engine/server.py:536, backtest/runner.py:1476-1479 |
holdout_pct | validate | number 0–0.5 | 0 | share of bars | Last share of bars sealed from every check. | engine/server.py:538, backtest/validation.py:53 |
open_holdout | validate | boolean | false | Run once on the sealed bars and record the opening. | engine/server.py:540 | |
suite | validate | "standard" / "institutional" | "standard" | Which suite. | engine/server.py:543 | |
budget_s | validate | number | 120 | seconds | Soft time budget; clamped to 10–900. | engine/server.py:545, engine/server.py:1586 |
6.3 Arguments on the assistant's tools
These wrap the same engine calls. Only what differs is listed.
| Name | Tool | Type | Default | Units | Meaning | Source |
|---|---|---|---|---|---|---|
from, to | all four | date string | none | YYYY-MM-DD | Passed into run options. | engine/server.py:4245-4248 |
commission_pct, slippage_bps, spread_bps, capital | run_backtest | number | none | as 6.1 | Passed into run options. | engine/server.py:4253 |
commission_pct, slippage_bps | run_validation | number | none | as 6.1 | Passed into run options. | engine/server.py:4397 |
budget_s | run_validation | number | 45 | seconds | Clamped to 10–45. | engine/server.py:4429 |
6.4 Fixed limits and constants
| Name | Value | Meaning | Source |
|---|---|---|---|
MAX_COMBOS | 500 | Largest parameter grid. | backtest/runner.py:1390 |
| values per spec | 10,000 | Largest expansion of one lo:hi:step. | backtest/research.py:284 |
_IMPACT_CAP | 0.5 | Cap on square-root impact per fill. | backtest/runner.py:862 |
MAX_HOLDOUT_PCT | 0.5 | Largest holdout share. | backtest/validation.py:53 |
min_trades | 30 | Below this, a caution. | backtest/research.py:426 |
min_wf_efficiency | 0.5 | Walk-forward veto line. | backtest/research.py:429 |
min_dsr | 0.95 | Deflated Sharpe veto line. | backtest/research.py:431 |
max_mc_prob_loss | 0.20 | Monte Carlo P(loss) veto line. | backtest/research.py:433 |
max_mc_ruin | 0.01 | Monte Carlo ruin veto line. | backtest/research.py:435 |
cost_multiplier_must_survive | 2.0 | Cost multiple that must still be profitable. | backtest/research.py:438 |
min_sensitivity_profitable_share | 0.5 | Grid share that must be profitable. | backtest/research.py:441 |
BOOT_DRAWS | 500 | Resamples for Reality Check, SPA, Romano–Wolf. | backtest/overfit.py:55 |
PBO_BLOCKS | 16 | CSCV blocks. | backtest/overfit.py:56 |
CPCV_GROUPS, CPCV_TEST | 6, 2 | CPCV groups and test groups per split. | backtest/overfit.py:60 |
NOISE_RUNS, JITTER_RUNS, JITTER_BARS | 20, 20, 2 | Noise and jitter reruns; jitter range. | backtest/overfit.py:61-63 |
BOOTSTRAP_DRAWS | 1000 | Resamples for the confidence intervals. | backtest/stats.py:982 |
PERMUTATIONS, PERMUTATIONS_MIN | 100, 20 | Permuted paths; minimum to grade. | backtest/stats.py:889-890 |
RANDOM_ENTRY_DRAWS | 1000 | Random-timing strategies. | backtest/stats.py:1049 |
LO_LAGS | 10 | Lags in Lo's correction. | backtest/stats.py:737 |
NULL_SERIES | 20 | Noise series in the null-data test. | backtest/integrity.py:63 |
TRUNCATION_FRACS | 0.60, 0.75, 0.90 | Cuts in the truncation test. | backtest/integrity.py:51 |
DELAY_KEEP | 0.25 | Share of profit a one-bar delay must keep. | backtest/integrity.py:62 |
TOL_FRAC | 0.0001 | Tolerance for known-answer and shadow engine, as a share of capital. | backtest/integrity.py:50 |
| preset slippage, latency, financing | 0.1; 1 bar; 500 / 300 bps | The realistic preset (2.10). | backtest/execution.py:68-71 |