Project · 2026
Business Cycle Engine
A Pring-style six-stage model of the business cycle for Canada and the United States. Three barometers read bonds, stocks and commodities, the stage tells you where in the cycle the markets are, and every claim is tested out of sample before it is believed.
01 Overview
Six stages, three barometers
Martin Pring describes the business cycle as a sequence: bonds turn first, then stocks, then commodities, and they peak in the same order. Six combinations of bullish and bearish markets map to six stages, from Stage 1 (only bonds bullish) to Stage 6 (everything bearish).
Pring's own barometers are proprietary, so this is a documented approximation, not a replication. Each barometer is a vote of four to six trend and momentum tests, including Pring's long-term KST, scored from 0 to 100 and smoothed over two months. Fifty or above is bullish.
Canada is the primary market, with the United States as the reference where the model was born. Every month is classified using only what was known at the end of that month, with publication lags applied and, in real-time mode, the data as it was first released.
A cycle model is only useful if it survives the data it was not fitted on. Most of this project is the testing.
02 What it does
From classification to a tradable signal
Built for a CAD-based investor and for the trading systems that consume it.
Current stage and distance to flip
The stage in each country, the three barometer readings, and how many component changes would flip each one next month.
Honest statistics
Forward returns by stage with Newey-West errors, block-bootstrap intervals, subperiod tests and a shuffled-label placebo.
Walk-forward backtest
Stage-based allocation in CAD, hedged and unhedged, net of costs, with only stitched out-of-sample results reported, a Deflated Sharpe Ratio and a probability of overfitting.
Statistical benchmark
A hidden Markov model refit on an expanding window, to test whether the six-stage structure adds anything a purely statistical regime model does not.
Cross-asset modules
USDCAD by stage, implied and realized volatility with the variance risk premium, and sector rotation in both countries.
Regime feed
A versioned, schema-validated monthly feed of stage, barometer scores and regime labels for downstream options and FX tools.
03 What the data says
Weak in the US, absent in Canada
In the United States, stages carry a modest amount of information about the next one to three months, mostly in commodities and in early-cycle stocks. A shuffled-label placebo puts that at the edge of statistical significance. In Canada the placebo cannot rule out chance at any horizon.
As an allocation rule, the stage strategy beats the hidden Markov model in both countries but trails a plain global 60/40 portfolio out of sample. The six-stage map is a useful way to describe the regime. It is not, on this evidence, a return forecast.
The full method, every formula, the data sources and the limitations are documented alongside the code, including the ones that make the model look worse.
04 Under the hood
Reproducible by construction
Every series is verified against its provider before first use, cached with a timestamp and a content hash, and flagged if it goes stale. Z-scores, thresholds and parameters use expanding or rolling windows only, never the full sample, and a test asserts that changing future data never changes a past classification.
A GitHub Action reruns the whole engine on the second business day of each month for the official reading, and a lighter job refreshes a provisional reading for the month in progress every weekday evening, using the latest market closes. The provisional reading is shown separately and never mixed into the tested monthly series. API keys live only as encrypted repository secrets.
A Pring-style approximation of a proprietary model, not a replication. Data from the Bank of Canada, Statistics Canada, FRED / ALFRED, the C.D. Howe Institute Business Cycle Council and Yahoo Finance. Educational and decision-support use only, not investment advice.
Where are we in the cycle?
The dashboard shows the current stage for Canada and the United States, the barometers behind it, and the evidence for and against it.