Alexander Hübbert
  • Home
  • Research
  • Articles
  • Learn
  • CV

Articles

Articles

Backtests, data, and equity strategy ideas. Code when relevant. Readers who want to start from the foundations can use Learn, where Python and R are taught.

Aug 31, 2026

Six ways to clean your trading data into the wrong answer

Six ordinary processing steps, each measured against a truth known by construction. One dropna call takes a third off the terminal wealth, and a missing delisting return adds 73.1%.

Python Backtesting Statistics Code
Read article
Six data-processing mistakes on one scale, from -23.2% to +73.1% error in the terminal wealth a backtest reports.
Aug 18, 2026

When a company changes its name, should you sell?

On its own a name change predicts almost nothing. Among firms that were losing money before they renamed, the renamers underperform comparable firms by roughly 13 percentage points over the following year.

Statistics Backtesting Python Code
Read article
Median 12-month return of renaming firms against matched controls, split by whether the firm was profitable before the rename.
Aug 11, 2026

Same data, same trading signal, different answer

On simulated data where the edge is real, the reported return runs from -1.6% to +6.3% a year, depending on eight ordinary portfolio choices.

Python Backtesting Code
Read article
A quant working at a laptop, for a post on how ordinary choices change a backtest's conclusion.
Jul 26, 2026

The art of thinking clearly as a quant

Six biases that distort quantitative research, each one measured on a simulated market where the truth is known in advance.

Python Statistics Code
Read article
An open book beside a laptop showing a chart, for a post on biases in quantitative research.
Jul 25, 2026

When out of sample stops being out of sample

On a simulated market with no edge, a researcher who keeps tuning against a hold-out pushes its Sharpe ratio to 2.8, while a final test set opened once stays at zero. An out-of-sample test becomes in-sample the moment we optimise against it.

Python Backtesting Statistics Code
Read article
A control panel labelled Strategy Parameters, with knobs for lookback, volatility filter, size screen, momentum tilt and weight limit.
Jul 24, 2026

Pull US Insider-Transaction Data from LSEG in Python

A resumable pipeline for pulling insider transactions for every canonical US stock from LSEG Workspace, chunked by RIC with a retry loop and a field-name probe.

API Python Downloading data Code
Read article
downloading US insider-trade data from LSEG in Python
Jul 24, 2026

Download Every US IPO from LSEG in Python

A copy-paste pipeline for pulling every US IPO since 1988 from LSEG's SDC deals database, survivorship-free, then cleaning it to the academic operating-company universe.

API Python Downloading data Code
Read article
downloading US IPO data from LSEG in Python
Jul 23, 2026

Buy the dip? US vs. Europe

I test buying a stock after its drawdown crosses a threshold and holding 12 months, across the US and 13 European markets. It roughly held in the US and got steadily worse across Europe.

Python Backtesting Code
Read article
Median 12-month abnormal return after a drawdown, US against Europe, by drawdown threshold.
Jul 20, 2026

Should you wait for new lows or new highs?

In this post, I show that waiting for new S&P 500 highs or lows usually produced lower returns over ten years than investing every month.

Python Backtesting Code
Read article
Difference in annual IRR for two waiting rules, against how strict the rule is.
Jul 19, 2026

Connect to IBKR with Python

This post shows how to connect Python to Interactive Brokers with ib_async and download historical prices into pandas.

Python API Downloading data Code
Read article
Python code connects to the Trader Workstation desktop app, which connects to Interactive Brokers.
Jul 19, 2026

Backtests tell you sweet little lies

A 25-year Swedish backtest of a 12-2 momentum strategy against the market, with three layers of trading costs. Momentum won before costs, and the bid-ask spread took most of the win.

Python Backtesting Code
Read article
Momentum on Swedish stocks against the market, 2001 to 2025, before and after costs.
Jul 19, 2026

Currency risk matters, especially if you are Swedish or Swiss

The same S&P 500 total return, 1988 to 2026, converted into six home currencies unhedged, delivered final multiples from 41.1x in Swiss francs to 109.7x in Swedish kronor.

Python Backtesting Code
Read article
Growth of one unit in the S&P 500 total return, in six home currencies, 1988 to 2026.
Jul 18, 2026

The Magic Formula worked. Just not lately.

A 25-year US backtest of Greenblatt's Magic Formula against the S&P 500, with trading costs. It beat the market overall, and stopped beating it around 2015.

Python Backtesting Code
Read article
Magic Formula portfolio against the S&P 500, 2001 to 2026, with a rolling five-year premium.
Jul 17, 2026

The longer you hold a stock, the less likely you are to beat the market

A forward-horizon study of every US stock from 2000 to 2026. At one year nearly half beat the S&P 500, but by 15 years only about one in four did, because a few big winners carry the index.

Python Backtesting Code
Read article
Share of US stocks that beat the S&P 500, by holding horizon from 1 to 15 years, 2000 to 2026.
Jul 16, 2026

Why a model with no predictive power can score 90% accuracy

When an outcome spans several future observations, training labels can overlap the test period. This post shows how purging that overlap removes the inflated accuracy.

Python Machine Learning Backtesting Code
Read article
Diagram showing how purging prevents training outcomes from overlapping the test period.
Jul 13, 2026

Does your backtested Sharpe ratio show a real edge?

On a simulated market built to contain no edge, a search across 216 strategies returns a winner with a Sharpe ratio of 0.72. Bootstrapping shows how much of that is precision and how much is the search itself.

Python Backtesting Statistics Code
Read article
Does your backtested Sharpe ratio show a real edge?
Jul 12, 2026

Download Tick Data from LSEG Tick History in Python

Download trade and quote data from LSEG Tick History using Python, with chunked requests, automatic retries and resumable CSV exports.

API Python Downloading data Code
Read article
Download Tick Data from LSEG Tick History in Python
Jul 10, 2026

IPO boom = market top? The data says otherwise

A threshold test over the 1988 to 2025 record: heavy IPO activity did not precede weaker S&P 500 returns. The abnormal return stayed near zero and changed sign.

Python Backtesting Code
Read article
Next-12-month S&P 500 abnormal return by prior-year IPO intensity threshold.
Jul 8, 2026

Does the price of butter predict the S&P 500? The reason you need cointegration.

Two unrelated series can appear highly correlated, even when there is no real relationship between them.

Python Backtesting Statistics Code
Read article
Does the price of butter predict the S&P 500? The reason you need cointegration.
Jul 5, 2026

How to write better

Five rules for focusing your writing and saying more with less.

Writing
Read article
How to write better
Jul 3, 2026

Expensive IPOs are a free lunch for about a day

A 26-year study of 2,417 US IPOs sorted by debut size and by valuation. The first-day pop is a size threshold, and among profitable IPOs the first-year return falls straight down the valuation ladder.

Python Backtesting Code
Read article
Median first-day pop, day-one open-to-close, one-month and one-year return by US IPO size quintile, 2000 to 2026.
Jun 30, 2026

Can a chess rating system predict World Cup winners?

A walk-forward test of the chess rating system on four World Cups.

Python Backtesting Code
Read article
Can a chess rating system predict World Cup winners?
Jun 24, 2026

Avoiding bad companies matters as much as finding great ones

A US backtest of the highest-quality companies against the lowest-quality, equal-weight and net of costs, 2000 to 2026. The best compounded; the worst fell 91%.

Python Backtesting Code
Read article
Growth of one dollar and drawdown for high-quality against low-quality US companies, 2000 to 2026.
Jun 8, 2026

How to Backtest a Strategy

A backtest end to end in four steps with the bt library, run on simulated data with a known edge, so it needs no data subscription to reproduce.

Python Backtesting Code
Read article
How to Backtest a Strategy
Jun 3, 2026

Are markets overvalued?

Three portfolios' performance across the full range of S&P 500 monthly returns, 1988 to 2026.

Python Backtesting Code
Read article
Are markets overvalued?
May 27, 2026

Estimating the Frequency of Market Crimes

Using Detection-Controlled Estimation to recover hidden market crimes from observed prosecutions.

Python Code
Read article
Estimating the Frequency of Market Crimes
May 24, 2026

How constant are discount rates?

A cross-sectional study of US firms shows WACC persistence is moderate at one year and fades toward noise over five, following Bali, Engle and Murray (2016).

Python Cost of Capital Code
Read article
How the cross-sectional correlation of WACC and its components decays over one to five years.
May 20, 2026

Investing in high-yield dividend stocks?

A monthly-rebalanced, equal-weighted portfolio of the top 30 highest-yielding US stocks benchmarked against the S&P 500.

Python Backtesting Code
Read article
Investing in high-yield dividend stocks?
May 11, 2026

Does a Large One-Day Move in the S&P 500 Predict Next Week's Return?

One-week S&P 500 total-return outcomes after large single-day moves, 1988 to 2026.

Python Backtesting Code
Read article
Does a Large One-Day Move in the S&P 500 Predict Next Week's Return?
Apr 24, 2026

Just 4% of stocks created nearly all the wealth

A replication of Bessembinder (2018) on US and European stocks, 2000 to 2026. The top 5.4% of US stocks and 4.4% of European stocks account for all the net wealth created.

Python Code
Read article
Cumulative share of net wealth created by the top few percent of stocks, US and Europe.
Apr 22, 2026

Following insider trades?

A monthly-rebalanced, equal-weighted portfolio of the largest net-dollar insider buyers benchmarked against the S&P 500.

Python Backtesting Code
Read article
Following insider trades?
Apr 20, 2026

Classify Insiders as Informed

Classifying insiders as informed according to Cohen, Malloy & Pomorski (2012) routine/opportunistic insider split.

Code Python
Read article
Classify Insiders as Informed
Apr 10, 2026

Download Stock Data from LSEG Workspace in Python

A copy-paste pipeline for pulling every Swedish stock since 2000, active and delisted, into one CSV.

API Python Downloading data Code
Read article
Download Stock Data from LSEG Workspace in Python

Categories

No matching items
Alexander Hübbert

Postdoctoral Researcher in Finance.

Home Research Articles Learn CV
LinkedIn Email RSS
© 2026 Alexander Hübbert