IBKR QUANT BLOG · RESEARCH
Quant blog
DATA · CODE · CAVEATS
The IBKR Quant Blog is a long-form column on models, data and code. This page turns it into a checklist: where the data comes from, how the code runs, where backtests mislead and how to read the numbers.
- Reviewed Nov 2026
- 8 tables
- 8 questions
- 10,000 paths
01
What the blog covers
Three article types, three readings.
Posts rarely hand over a conclusion. They offer a path: an observation, a testable hypothesis and a script you can rerun. Topics cluster around factors, volatility, execution cost and code.
| Type | Data | Code | Take away |
|---|---|---|---|
| Method note | Panel data | Short snippets | Test design |
| Code tutorial | API fields | Full script | A rerunnable pipeline |
| Market note | Event samples | Plot script | Tail risk |
02
Five questions to ask of data
Change the adjustment and the backtest doubles.
The same prices, adjusted differently or drawn from another universe, produce a different curve. None of this needs statistics; the author has to say so.
| Check | Symptom | Effect |
|---|---|---|
| Sample period | Only bull years | Return overstated |
| Survivorship | Only listed names | Small caps flattered |
| Adjustments | Splits ignored | False breakouts |
| Time alignment | Asia and US offset | Look-ahead leaks |
| Missing values | Dropped or zero-filled | Sample distorts |
Missing disclosure is usually not an oversight.
03
Code and environment
Reproducibility is a threshold, not a virtue.
When one script gives different numbers elsewhere, the strategy rarely changed; the package version, random seed or data snapshot did.
| Item | Minimum | Verify |
|---|---|---|
| Data snapshot | Vendor and cutoff | Re-download same day |
| Code version | Pinned dependencies | Clean environment |
| Random seed | Stored with output | Reruns match exactly |
| Cost model | Commission, slippage, borrow | Each item listed |
| Outputs | Metrics and charts apart | Compare by column |
seed = 20261121
paths = 10000
S0, mu, sigma, cost = 100000, 0.08, 0.15, 0.0048
for path in range(paths):
equity = peak = S0
mdd = 0.0
for day in range(252):
r = (mu - cost) / 252 + sigma / sqrt(252) * randn()
equity *= exp(r)
peak = max(peak, equity)
mdd = max(mdd, 1 - equity / peak)
record(equity, mdd)The loop keeps seed, drift, cost and drawdown on purpose; drop one and readers trust a screenshot.
04
Five backtest traps
A smooth curve is not a small risk.
Backtest errors come from the process, not the maths. Miss one and discount the conclusion.
| Trap | Why it works | Check |
|---|---|---|
| Look-ahead | Uses post-close data | Delay the signal a day |
| Overfitting | Tuned in-sample | Perturb for stability |
| Understated cost | Slippage and borrow ignored | Recompute conservatively |
| Out-of-sample failure | One period only | Rolling walk-forward |
| Multiple testing | Best of many trials | Deflated Sharpe ratio |
Run two hundred parameter sets and the best looks good by construction.
05
Factor models
Split return into exposure and residual.
One market factor explains most variance; add size, value, momentum, quality and low volatility, and the residual looks like the strategy itself.
| Factor | Definition | Mistake |
|---|---|---|
| Market | Excess return over cash | Wrong benchmark |
| Size | Spread across market cap | Microcap liquidity |
| Value | Book-to-market | Report dates misaligned |
| Momentum | Trailing 12 months | Latest month not skipped |
| Quality | Profitability and leverage | No industry neutralization |
| Low volatility | Volatility-sorted | No leverage adjustment |
A higher R-squared is not better. If factors explain too much, the residual is cost plus luck.
Exposures drift; one regression is a snapshot.
06
Worked example: 10,000 simulations, 5% tail, drawdown
Write the assumptions down or the numbers mean nothing.
Start with $100,000, 8% expected return, 15% volatility, 252 trading days and 0.48% annual cost. Simulate 10,000 paths with seed 20261121.
This is a distribution, not a forecast: median equity $108,057, 5th percentile $84,203, median max drawdown 12.63%, 95th percentile 24.09%.
| Metric | 5th | 25th | 50th | 75th | 95th |
|---|---|---|---|---|---|
| Terminal equity (USD) | 84,203 | 97,714 | 108,057 | 119,379 | 137,652 |
| Max drawdown | 6.97% | 9.75% | 12.63% | 16.62% | 24.09% |
The worst 5% is 500 paths: average max drawdown 27.56%, deepest 39.06%, median equity $80,624. One path in twenty is no rounding error.
A down year happens 30.3% of the time; drawdowns past 20% in 12.4% of paths; a 0.48% cost trims median equity by about $500.
Rerun at 25% volatility and the median drawdown deepens sharply.
07
Who it is for
Patience required; olympiad maths not.
| Reader | Start here | What you get |
|---|---|---|
| Retail investor with Python | Code, traps | Backtests stop feeling like promises |
| Financial adviser | Factors, costs | A clearer story on diversification |
| New quant researcher | Data checks, checklist | A pipeline that reruns |
| IBKR API user | Code tutorials | Field alignment, cost estimates |
You do not need C++ or a large account, only acceptance that most attractive results vanish on another sample.
If you want buy and sell calls, this page will not give them.
08
Eight questions
The questions that arrive most often.
01Is the quant blog suitable for a beginner?
Method posts are readable; code posts expect Python. Start with sections 02 and 04.
02Can I trade a strategy straight from a post?
Reproduce it, add costs, test out of sample, then size it.
03Why is a backtest great and live trading poor?
Usually understated costs, slippage, look-ahead bias or out-of-sample failure.
04Do I need an IBKR account to read it?
No. Posts are public and examples use public data.
05Are 10,000 simulations enough?
For medians yes; thin for the 1% tail. Raise paths to 100,000.
06Do I have to build a factor model?
Not strictly, but it separates market exposure from the strategy.
07What language are the examples in?
Mostly Python, with some TWS API examples.
08How often is the blog updated?
Methods age slowly; data and cost sections are reviewed yearly, latest 2026.
09
Sources and review dates
Re-checked in November 2026. Names and dates only; no links.
| Source | Type | Sections | Reviewed |
|---|---|---|---|
| IBKR Quant Blog | Articles | 01, 06 | 2026-11-18 |
| IBKR Campus pages | Teaching | 07 | 2026-11-18 |
| IBKR TWS API docs | Docs | 03 | 2026-11-19 |
| TWS user manual | Manual | 03 | 2026-11-19 |
| Deflated Sharpe Ratio (Bailey, Lopez de Prado, 2014) | Paper | 04 | 2026-11-20 |
| Time Series Momentum (Moskowitz et al., 2012) | Paper | 05 | 2026-11-20 |
| Three-factor model (Fama and French, 1993) | Paper | 05 | 2026-11-20 |
| Backtest overfitting (Bailey et al., 2016) | Paper | 04, 06 | 2026-11-21 |
A methods summary, not investment advice. All figures are simulated.