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)

NameTypeDefaultUnitsMeaningSource
capitalnumber > 0100000account currencyStarting cash. initial_capital is accepted as a fallback name.backtest/runner.py:368
commission_pctnumber >= 00% of notional per sideCommission on each fill.backtest/runner.py:377
slippage_bpsnumber >= 00bps of price per fillMoves every fill against the trader.backtest/runner.py:378
spread_bpsnumber >= 00bps of price per fillHalf the bid/ask spread.backtest/runner.py:920
spread"data" / "bps" / absentabsent"data" reads the half-spread from bid and ask columns.backtest/runner.py:890
spread_data_scalenumber >= 01multipleScales 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_knumber >= 00.1multiple of bar σVolatility slippage coefficient ("vol" only).backtest/runner.py:949
slippage_vol_barswhole number >= 220barsVolatility window ("vol" only).backtest/runner.py:950
impact_cnumber >= 01.0coefficientSquare-root impact coefficient ("sqrt_impact" only).backtest/runner.py:961
latency_barswhole number >= 00barsFills N bars later, at that bar's open.backtest/runner.py:910
financing_bps_annualnumber (may be negative)0bps per yearCarry on notional held, both sides.backtest/runner.py:914
financing_long_bpsnumber (may be negative)financing_bps_annualbps per yearCarry for longs.backtest/runner.py:915
financing_short_bpsnumber (may be negative)financing_bps_annualbps per yearCarry for shorts.backtest/runner.py:916
size_scalenumber > 01multipleMultiplies every explicit qty.backtest/runner.py:917
fromdate string or epochnoneUTC date, or epoch seconds / msFirst bar to include.backtest/runner.py:1573
todate string or epochnoneUTC date, or epoch seconds / msLast bar to include.backtest/runner.py:1574
paramsobject name → value{}Values the script reads with params.get.backtest/runner.py:388
extended_statsbooleanfalseAdds stats.extended (3.5).backtest/runner.py:420
timeoutnumber > 0120secondsPer-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)

NameApplies toTypeDefaultUnitsMeaningSource
engineallstring"python"Backtest engine.engine/server.py:495
providerallstringrequiredWhere candles come from (userdata, backend).engine/server.py:496
symbolallstringrequiredDataset or instrument.engine/server.py:497
timeframeallstring"1h"Bar size.engine/server.py:498
scriptallstringrequiredThe strategy source.engine/server.py:499
limitallinteger0bars0 = 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
optionsallobject{}Run options (6.1).engine/server.py:505
datasetsalllist of names[]Side datasets to attach explicitly.engine/server.py:507
runsMonte Carlo, validateinteger1000pathsClamped to 1–100,000.engine/server.py:511, engine/server.py:533, engine/server.py:1537
seedMonte Carlo, validateinteger42Seed for every random draw. Must be >= 0 for the institutional suite.engine/server.py:512, engine/server.py:534, backtest/validation.py:178-181
paramswalk-forward, validateobject 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
foldswalk-forward, validateinteger >= 14Number of test windows.engine/server.py:518, engine/server.py:530
trainwalk-forward, validatenumber in (0, 1)0.7shareTraining share within each fold.engine/server.py:519, engine/server.py:531
metricwalk-forward, validatestring"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
checksvalidatelist["baseline"]Any of baseline, walkforward, montecarlo, costs, sensitivity, dsr.engine/server.py:526, backtest/validation.py:51
cost_multipliersvalidatelist of 1–10 numbers >= 0[1, 2, 3]multiplesCost stress levels.engine/server.py:536, backtest/runner.py:1476-1479
holdout_pctvalidatenumber 0–0.50share of barsLast share of bars sealed from every check.engine/server.py:538, backtest/validation.py:53
open_holdoutvalidatebooleanfalseRun once on the sealed bars and record the opening.engine/server.py:540
suitevalidate"standard" / "institutional""standard"Which suite.engine/server.py:543
budget_svalidatenumber120secondsSoft 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.

NameToolTypeDefaultUnitsMeaningSource
from, toall fourdate stringnoneYYYY-MM-DDPassed into run options.engine/server.py:4245-4248
commission_pct, slippage_bps, spread_bps, capitalrun_backtestnumbernoneas 6.1Passed into run options.engine/server.py:4253
commission_pct, slippage_bpsrun_validationnumbernoneas 6.1Passed into run options.engine/server.py:4397
budget_srun_validationnumber45secondsClamped to 10–45.engine/server.py:4429

6.4 Fixed limits and constants

NameValueMeaningSource
MAX_COMBOS500Largest parameter grid.backtest/runner.py:1390
values per spec10,000Largest expansion of one lo:hi:step.backtest/research.py:284
_IMPACT_CAP0.5Cap on square-root impact per fill.backtest/runner.py:862
MAX_HOLDOUT_PCT0.5Largest holdout share.backtest/validation.py:53
min_trades30Below this, a caution.backtest/research.py:426
min_wf_efficiency0.5Walk-forward veto line.backtest/research.py:429
min_dsr0.95Deflated Sharpe veto line.backtest/research.py:431
max_mc_prob_loss0.20Monte Carlo P(loss) veto line.backtest/research.py:433
max_mc_ruin0.01Monte Carlo ruin veto line.backtest/research.py:435
cost_multiplier_must_survive2.0Cost multiple that must still be profitable.backtest/research.py:438
min_sensitivity_profitable_share0.5Grid share that must be profitable.backtest/research.py:441
BOOT_DRAWS500Resamples for Reality Check, SPA, Romano–Wolf.backtest/overfit.py:55
PBO_BLOCKS16CSCV blocks.backtest/overfit.py:56
CPCV_GROUPS, CPCV_TEST6, 2CPCV groups and test groups per split.backtest/overfit.py:60
NOISE_RUNS, JITTER_RUNS, JITTER_BARS20, 20, 2Noise and jitter reruns; jitter range.backtest/overfit.py:61-63
BOOTSTRAP_DRAWS1000Resamples for the confidence intervals.backtest/stats.py:982
PERMUTATIONS, PERMUTATIONS_MIN100, 20Permuted paths; minimum to grade.backtest/stats.py:889-890
RANDOM_ENTRY_DRAWS1000Random-timing strategies.backtest/stats.py:1049
LO_LAGS10Lags in Lo's correction.backtest/stats.py:737
NULL_SERIES20Noise series in the null-data test.backtest/integrity.py:63
TRUNCATION_FRACS0.60, 0.75, 0.90Cuts in the truncation test.backtest/integrity.py:51
DELAY_KEEP0.25Share of profit a one-bar delay must keep.backtest/integrity.py:62
TOL_FRAC0.0001Tolerance for known-answer and shadow engine, as a share of capital.backtest/integrity.py:50
preset slippage, latency, financing0.1; 1 bar; 500 / 300 bpsThe realistic preset (2.10).backtest/execution.py:68-71