Backtesting guide
Backtest Sensitivity Analysis
Backtest sensitivity analysis measures how selected outputs change when strategy inputs or assumptions are varied within declared ranges. It helps locate fragile dependencies, but it does not establish that the strategy has a genuine or persistent edge.
Read the practical guideKey Takeaways
- Define the output, input range, and acceptance rule before running variations.
- Vary one assumption at a time before testing interactions across a grid.
- Include dates, costs, fills, and data choices as well as strategy parameters.
- Treat a smooth result as evidence about dependence, not future performance.
Define the sensitivity question
Select an output such as net profit, drawdown, trade count, or risk-adjusted return. Then choose the inputs that could materially change it: lookback length, threshold, start date, commission, slippage, fill rule, or rebalance frequency. Each range should reflect a plausible alternative rather than values chosen after seeing the result.
- Name one primary output and a small set of risk constraints.
- Set ranges and step sizes before running the comparison.
- Keep a record of every tested value and its result.
Test main effects before interactions
A one-at-a-time test is easy to interpret because only one input changes. A grid can reveal interactions, such as a lookback that works only with one threshold, but the number of trials grows quickly. Use the simple test to identify material inputs, then reserve the grid for combinations supported by the strategy logic.
- Hold symbol, timeframe, dates, and costs constant in parameter-only tests.
- Use a separate grid for cost and fill stress scenarios.
- Check whether trade count changes explain jumps in other metrics.
Interpret plateaus and cliffs carefully
A broad plateau suggests that the historical result is less dependent on one exact input. A cliff or isolated peak suggests fragility or a discontinuity in the trading rules. Neither pattern proves economic validity. Repeated searches across many inputs also create selection bias, so the trial count must remain visible and confirmation data must stay untouched.
- Compare neighboring results rather than ranking only the best cell.
- Inspect risk and turnover alongside the selected objective.
- Confirm the chosen region on data not used to define the range.
Related Pineify workflow
Use parameter sweeps as one part of sensitivity analysis
Pineify Strategy Optimizer can compare parameter combinations with consistent backtest assumptions and make local peaks or broader regions easier to inspect.
Run parameter combinations and compare the resulting performance and risk metrics.
Open Strategy OptimizerBoundary: The optimizer focuses on strategy parameter trials. It is not an independent sensitivity-analysis engine for every data, execution, and model assumption.
Primary sources
- NIST, A Survey of Sensitivity Analysis MethodologyVerified 2026-08-16
- Bailey, Borwein, Lopez de Prado, and Zhu, The Probability of Backtest OverfittingVerified 2026-08-16
- TradingView Pine Script strategies documentationVerified 2026-08-16
This page is educational and does not provide investment advice. Backtests are hypothetical, depend on their data and assumptions, and do not guarantee future results. Trading can result in substantial loss.