Quant & backtesting
Quant research, without fooling yourself.
A backtest is easy to make look good. These functions test trading ideas and also check whether a result is likely to hold outside the sample.
Backtest (BT) and backtest on the chart (BTST) run a strategy on history; walk-forward optimisation (WFO) re-fits it on rolling windows, and the backtest lab (BTLB) reports the probability of backtest overfitting (PBO) and the deflated Sharpe ratio.
For research, seasonality (SEA), market regimes (REGM), GARCH forecasts (GARCH), factor exposure (FACT), pairs trading (PAIR) and time-series momentum (TSMOM) cover the classic tools, with Python notebooks (QNT) for the rest.
What you can open
- BTBacktestA rule on daily bars, signal at t traded at t+1, with costs, t-stat, drawdown and an overfitting warning.
- BTSTBacktest on the chartBT’s entries and exits drawn on G, with each round trip’s return.
- WFOWalk-forward optimisationOut-of-sample testing of BT rules, sensitivity heat map, Monte Carlo and deflated Sharpe.
- BTLBBacktest LabPBO, deflated Sharpe, fills.
- BTIMBacktest ImportMultiCharts report: check, MC drawdown, DSR, PBO.
- SEASeasonalityHow a market tends to behave across the calendar, from daily history since 2000.
- SEAGSeasonal TableMonth-by-year returns from daily bars.
- REGMMarket regimesMarkov-switching regimes with probabilities, transition matrix and statistics by regime.
- GARCHGARCH forecastGARCH(1,1) and EWMA: persistence, half-life, 1–30 day forecast against implied volatility.
- RVOLRealized VolRange estimators, HAR, QLIKE.
- FACTFactor exposureFama–French five factors and momentum for a security or the book.
- PAIRPairs tradingCointegration tests, hedge ratio, z-score, half-life and a backtest without look-ahead.
- TSMOMTime-series momentumMomentum on 22 ETFs across asset classes at a 40 % target volatility.
- ALPHASignal researchInformation coefficient, t-stat, quantile returns, decay and turnover of a signal.
- QNTPython notebooksNotebooks in the browser (numpy, pandas, scipy, statsmodels) on the terminal’s own data.
Glossary
Questions
- What is backtest overfitting?
- When a strategy is tuned until it fits past data by chance. It looks strong in the backtest and fails live; the more variants you try, the higher the risk.
- What is the deflated Sharpe ratio?
- A Sharpe ratio corrected for the number of trials and for non-normal returns, proposed by Bailey and López de Prado. It shows whether a result is likely to be more than luck.
- What is walk-forward optimisation?
- Fitting a strategy on one window of data, testing it on the next, then rolling forward. It mimics how the strategy would have been used in real time.