Quantitative and algorithmic trading: from hypothesis to test
Quantitative trading uses mathematical or statistical models to inform decisions. Algorithmic trading uses coded procedures for decisions or execution. A quantitative researcher may still approve trades manually, and an execution algorithm may follow a schedule without forecasting returns. People still choose the data, objectives, constraints, and deployment decisions.
Key Takeaways
- Quantitative research and algorithmic execution address different parts of a workflow.
- Specify data, timing, rules, and evaluation before interpreting performance.
- Correlation is not evidence of a stable tradable price relationship.
- Generated code and hypothetical fills require independent inspection.
Three hypotheses, not three proven strategies
Mean reversion asks whether deviations tend to reverse over a defined horizon. Trend following asks whether directional movement persists. Relative-value trading asks whether a relationship between instruments offers an opportunity after hedging and costs. These are research categories, not claims that one rule works in every market regime.
- Mean reversion: define the reference value, deviation measure, entry threshold, and maximum holding period.
- Trend following: define signal timing, exits, sizing, and the cost of repeated reversals.
- Relative value: define tradable instruments, a hedge ratio, spread construction, financing, and a rule for a broken relationship.
Specify a mean-reversion experiment before running it
An illustrative candidate could buy after a daily close falls two rolling standard deviations below a 20-session moving average, then exit at a return to the reference or after five sessions. These numbers are example parameters, not a tested recommendation. State whether the exit reference is fixed at entry or recalculated, when orders become eligible to fill, how overlapping signals are handled, and what happens across gaps. This page reports no Sharpe ratio, win rate, or live result for that candidate.
- For futures, identify contracts, roll rules, multipliers, sessions, and whether price adjustments affect signals.
- Reserve later data before choosing thresholds, then freeze the selected rule for evaluation.
- Include fees and plausible slippage; examine results across different cost assumptions.
- Compare with a declared baseline and report exposure, drawdown, trade counts, and rejected parameter trials.
Correlation does not establish a tradable spread
Two assets can have correlated returns while their price difference drifts. A cointegration analysis tests a different claim about a combination of nonstationary series. The statsmodels Engle–Granger test assumes I(1) inputs and uses no cointegration as its null hypothesis. A result depends on the sample and model specification; it does not establish future convergence or profitability. Do not assume that EURUSD and GBPUSD, or two technology stocks, are a suitable pair merely because they often move together.
- Align observation times and handle missing prices without introducing future information.
- Choose transformations, trend terms, hedge estimation, and lag rules explicitly.
- Account for pair selection and repeated statistical tests.
- Evaluate borrow availability, funding, leg-by-leg fills, and later relationship changes.
Separate model error from implementation error
A mathematically stated rule can still be implemented incorrectly. Inspect indicator warm-up, higher-timeframe data availability, order timing, and position transitions. TradingView’s broker emulator produces hypothetical fills under its configured assumptions. A multi-instrument signal does not mean its Strategy Tester simulates an independently traded portfolio of all requested symbols; model a pair’s separate legs in a suitable portfolio test.
- Compilation establishes code structure, not correct trading behavior.
- An unusually high win rate alone does not prove overfitting or future failure; inspect payoffs, samples, costs, and how the rule was selected.
- A loss limit requests a response; gaps and failed execution can exceed the intended loss.
- Document manual interventions and model changes instead of assuming automation removes human bias.
Choose tools around the experiment
Pine Script fits chart-based indicators and strategies on TradingView. A research environment with the required statistical libraries and portfolio accounting may be needed for a multi-asset experiment. Pineify Coding Agent can draft Pine rules from a specification; review and test the output in TradingView. Data subscriptions, platform access, broker requirements, and live capital needs are separate, so there is no universal starting-dollar amount.
Educational research workflow. Example parameters are untested illustrations. Trading, software, and model failures can cause losses; historical performance does not establish future results.