Research

The Macro Regime Engine: How I Built a System That Sidestepped Every Major Crash & Outperformed Buy & Hold Since 1999

This is the full story. The obsession, the failures, the rebuild, and where we are now.. 26 years of backtested history, 38 trades, a 9.75% max drawdown, and a system I trust with my own capital.

March 29, 2026by @DurdenBTC

It’s finally time to update the pinned post for my Substack. This new article will encapsulate the entire journey of me building the MRE engine & where it stands as of this writing. The last 4+ months have been nothing short of incredible and I am extremely thankful for all the folks who have supported me from the beginning. You know who you are. I appreciate you. Let’s dive in.


Everyone wants the magic indicator that triples their money.

I know, because I spent over a year hunting for it. Literally. Countless nights on TradingView going page 30, 40, 50, 100+ deep.. digging through every “macro-aware” trend-following indicator I could find. And no, I’m not kidding.. I think I ended my ‘indicator hunt’ on page 109 or 119, can’t remember which.

Almost every indicator I reviewed was junk. Most were stitched together with MAs or EMAs (too simple) or loaded with dozens of hyper-specific inputs (too complex.. you could smell the overfit).

When I finally found something interesting, I’d crack open the PineScript. It’s pretty easy to see if there’s real value under the hood.

Plot un-twist: there wasn’t.

Eventually I realized the magic indicator is a dead end. Markets are just probabilities, and the only real edge is tilting those probabilities in your favor.

So I switched objectives. I stopped looking for the thing that prints money and started looking for the thing that stops lighting my portfolio on fire every time the macro gods feel displeased with us mortals making too many positive returns.

That shift changed everything.

“Nothing in the world is worth having or worth doing unless it means effort, pain, difficulty… I have never in my life envied a human being who led an easy life. I have envied a great many people who led difficult lives and led them well.”

- Theodore Roosevelt


The Inspiration

The inspiration for this entire project comes from Darius Dale & his 42Macro VAMS framework (Volatility-Adjusted Momentum Scores across assets). Darius does incredible work.. his company & the research they put out are second to none.

I don’t claim to be some macro guru. I haven’t spent 20+ years at Goldman Sachs. I’m someone who spent 20+ years in tech coding every possible stupid startup idea or app in almost every programming language you can think of (PHP, Python, Ruby, Rust, Go, Java, Elixir, etc)..

I just happen to also be obsessed with finance, macro & investing.

I stand on the shoulders of giants. I didn’t invent the framework.. Darius and the institutional world (Dalio, Tudor Jones, Kovner, etc) did that work decades before I ever opened a Pine Editor.

I’m just trying to take the best research available, strip it down to what I can control, and sharpen the blade.

a photo I took from one of my dev jobs 12+ years ago when I finally hit “senior” software engineer.. this was back when Slack first hit the scene

So for me, if I can’t understand something at a base level.. meaning I can’t dissect the inputs and sources myself, then I can’t fully trust it.

I’ve learned that outsourcing your conviction only works when things are going well. Darius’ backtests are incredible and the system works beautifully.. but if confirmation is the queen then having your own conviction is king.

The other issue I had always lurking in the back of my head, scratching that part of your brain you can’t itch, was what if he takes his subscription private.. or jacks up the price 1,000%.. or closes his company for whatever reason. Then I’m up shits creek without a paddle.

Insert any number of catastrophic sequences that can throw the one thing you’re depending on to manage your wealth in the trash unexpectedly.

The main obstacle right off the bat: I don’t have $25,000 a year for a Bloomberg terminal (this is what Darius & almost all other professional shops use as their data source).

What I do have though.. is TradingView Premium with enough request.security power to pull 50+ symbols, a coding background, and a borderline unhealthy tolerance for staring at the Pine Editor until my eyes dampen.

I basically wanted a stripped-down but effective SPX-brained version of their model that I could control end-to-end. My symbols. My thresholds. My smoothing. My risk rules.

I wanted to own the engine.

a rare screenshot I took while developing the first version of the MRE in Dec 2025; you can clearly see two layered versions of the initial engine

The Idea: Democracy Across Markets

I wanted something different with this system. I wanted a vote across the entire macro landscape and put democracy to work:

What is credit saying? What is the dollar saying? What are breakevens, yields, commodities, volatility, FX, and high-beta risk saying.. together?

If enough of them point in the same direction.. that’s a regime.

Markets move based on the intersection of two forces: Growth and Inflation. Each could be rising or falling. Cross them and you get four distinct macro environments:

Goldilocks (Growth Up, Inflation Down): long everything.

Reflation (Growth Up, Inflation Up): commodity party, equities still work.

Inflation (Growth Down, Inflation Up): pain, cash is king.

Deflation (Growth Down, Inflation Down): run for cover.

The engine classifies the current environment into one of these four states, then makes one binary decision: Risk-On or Risk-Off.

Not a prediction machine. Just a binary survival tool.. a seatbelt, not a crystal ball.


Building the VATS Composite

At the core of the system sits a Volatility-Adjusted Trend Signal (VATS). Plain English version:

Take an asset. Look at how much it’s moved over some lookback period (momentum). Scale that move by how volatile it’s been (volatility). You get one number.. a VATS score.

High positive VAMS = trending up in a relatively calm way → bullish.
High negative VAMS = trending down in a relatively calm way → bearish.
Near zero = noisy chop.

Then compress it further: above a threshold → Bull (+1). Below negative threshold → Bear (−1). In between → Chop (0).

a rare screenshot of my first alpha version of the VATS tuner on BTC

Every asset is constantly voting bull, bear, or “meh.”

I track 20+ global assets across three tribes:

Growth / Risk: SPX, Nasdaq, Russell, EuroStoxx, Nikkei, Bitcoin, high yield credit spreads, growth FX. When these go bullish, they vote for Goldilocks and Reflation. When they puke, they vote for Inflation and Deflation.

Inflation / Reflation: Crude oil, broad commodities, 10Y breakeven inflation, 5Y5Y forward inflation. Bullish? They vote Reflation + Inflation. Bearish? Goldilocks + Deflation.

Deflation / Safety: DXY, 10Y TIPS real yields, nominal yields, MOVE, VIX, safety FX crosses. Bullish here usually means Deflation + Inflation. Bearish means Goldilocks + Reflation.

a peek ‘under the hood’ of the MRE and how specific assets vote (screenshot circa March 2026)

Each asset’s state maps to two regimes simultaneously, creating a 4-way voting system. Sum them up.. four numbers. Highest one wins. That’s the current regime.

“Success usually comes to those who are too busy to be looking for it.”

- Henry David Thoreau


Teaching It Not to Freak Out

Raw votes are noisy. Markets don’t move in clean four-act plays.. my first backtest confirmed that theory quite vividly given the system was risk-off for a good portion of the 2014 melt-up.

So I added two layers of sanity:

Minimum votes. A regime only “counts” if it has at least X confirming assets. No dictatorships allowed.

Time confirmation (hysteresis). Even if a new winner appears, the system doesn’t switch signals immediately. It has to stay in charge for N bars before the regime officially flips. This smooths the regime line and kills the false signals that would have wrecked my equity curve.


Phase 1: The “Perfect” Equity Curve

Over the last few weeks of late 2025 I spent countless hours in the lab (aka my home office) working through iteration after iteration. The bags of coffee I ripped through could supply a small diner for a month.

I ran the first real backtest.

Profit Factor: 5.87. Max Drawdown: ~11.8%. Equity Curve: a straight line up, ignoring 2008, 2020, and 2022.

I felt like I had solved the market. I was ready to mortgage the house.


Phase 2: The Reality Check (It Was Lying to Me)

Then I realized it was lying to me.

The backtest looked beautiful solely because the script was suffering from repainting. Repainting isn’t a difficult concept but is overlooked by many PineScript strategies and indicators.. and it will absolutely destroy your confidence in a system if you don’t catch it.

Here’s what happened: My script ran on a Daily chart but pulled Weekly macro data on certain inputs to filter out noise. The problem? When the script ran the backtest and asked the server on a Tuesday: “Hey, what did the Weekly candle look like?”.. the server, knowing the future state, would reply: “Well, by Friday, this candle closed Green.”

My strategy was buying on Tuesday based on Friday’s future close during the backtest trading. Big oopsie.

It’s easy to have a ~5.8 Profit Factor when you’re betting on a game that has already finished.

I tossed those results in the garbage.

I rewrote the engine with a strict rule: you can only make decisions based on data that is 100% closed and in the books. If I’m trading on Tuesday, I can’t look at the current week.

Only last week’s closed candle. In PineScript, that means strictly requesting the previous closed bar’s data ([1]) using lookahead=barmerge.lookahead_on.

I re-ran the backtest with non-repainting logic. The “perfect” line became jagged. The drawdown more than doubled to 30%. The Profit Factor dropped to 4.3.

It hurt to look at. But for the first time, the chart was real.


Phase 3: The 5D Eureka Moment

This is where things got interesting. I was trying to optimize the lag. Weekly data felt too slow.. if the market crashes on Monday, I didn’t want to wait until Friday to know about it.

I started testing weird timeframes.

1-Day: too noisy, too many fake-outs. 2-Day: not bad, but dramatically increased trade count and whipsaw. 3-Day: performance tanked compared to longer timeframes. 4-Day: much better, moving in the right direction for stability. 5-Day: holy shit.

The 5D timeframe outperformed everything. Not only did it beat buy & hold without pyramiding, it slashed maximum drawdown to ~14% with only 41 trades since 1997.

Why? Because the market is a macro ocean where the tides and waves shift in weeks, not days. A 3-Day cycle fights the rhythm of the business week. A 5-Day cycle aligns with it.

By forcing the engine to wait for a 5-Day “block” to close before changing its mind, I accidentally created the ultimate noise filter.

In 2020 (COVID) and 2008 (GFC), the market didn’t crash in a straight line. It crashed, bounced (head fake), and crashed again. My faster settings got whipsawed.. selling the crash, buying the bounce, selling the crash again.

The 5D setting was “dumb” enough to ignore the bounce. It saw the week started bad and ended bad, so it stayed out.

Sometimes, being a bit slow is a superpower.


Phase 4: The German Bund Incident

I tried to get fancy. Added the German 10Y Bund to get a “global” view of deflation.

The strategy immediately broke. Entire months of data turned into flat grey lines.

The culprit? Negative Interest Rates. Between 2019 and 2021, German yields went negative. My volatility formula uses logarithmic returns. You cannot take the log of a negative number. The math literally crashed, returned NaN (Not a Number), and the engine shut down.

The Bund wasn’t adding signal. It was adding noise (and math errors). I cut it and left my original set of 20+ assets, all focused on US macro plumbing.

Lesson learned: keep things focused & optimized specifically for the S&P 500.


The Final Engine: Receipts

After two months of iteration.. the repainting gut-punch, the 5D eureka, the Bund disaster, a two-hour break to re-watch Fifth Element for the 20th time (Aziz, light!), and more PineScript than any human should consume in a calendar year.. I put ‘pencils down’.

screenshot of the live MRE engine late March 2026

Here is where the engine sits today.

Backtested on ES1! futures from August 1999 through March 2026.

The trading logic is embarrassingly simple:

Risk-On (Goldilocks or Reflation): LONG ES futures, 100% of equity.
Risk-Off (Inflation or Deflation): FLAT. Exit to cash.

independent sample analysis of MRE backtest (outside of TradingView). please note: max drawdown here is intraday, close to close = 9.75%

No shorts. No hedging. No complex position management. This is not a “short every bear market” engine. It’s a “don’t be long when the house is on fire“ engine.

For the complete backtest numbers and full trade-by-trade analysis, please click here.


Why The Drawdown Number Is The Whole Point

The returns are nice. But the real edge isn’t the 8.26% CAGR.

It’s the 9.75% max drawdown while delivering those returns.

Most people focus on upside. The engine focuses on not giving it back.

Here’s the math that makes this system demolish buy-and-hold: a portfolio that drops 56% (GFC) needs a 127% gain just to get back to even. A portfolio that drops 9.75% needs a 10.8% gain. The engine spent 2008-2009 compounding from near its peak while buy-and-hold was rebuilding from a crater.

That differential compounds for the next decade.

Winning trades average 193 days. Losing trades average 56 days. When it’s right, it stays right. When it’s wrong, it gets out fast.

A Profit Factor of 14.78 means every dollar risked returned $14.78 in profit. The worst single loss in 26 years of trading was 3.37%.

This system went through the dot-com bust, 9/11, the financial crisis, the flash crash, the Euro crisis, COVID, and the 2022 bear market. 8.26% CAGR through all of it. With a 9.75% max drawdown.

How? It exits to cash during hostile regimes.

I wrote an entire article about how the system side-stepped the COVID crash the week of. Feel free to check it out for a deep dive.

In a survival portfolio, avoiding the zero is the only alpha that matters.


Validating It Wasn’t Lying (Again)

Backtests lie. Often. I already got burned once by repainting.. I wasn’t about to trust pretty numbers without verification.

The code is confirmed non-repainting:

Beyond the code review, I ran the system through full Monte Carlo and walk-forward analysis:

3,000 jitter simulations (randomizing entry/exit by ±2 days): 100% profitable. Median CAGR 8.9%. The 5th-to-95th percentile range was 8.2% to 9.6%.. extremely tight. The system doesn’t care if you’re a day or two late on execution.

3,000 bootstrap simulations (resampling trade returns): 100% profitable. 91.2% above a 5% CAGR.

15-fold walk-forward analysis (expanding window, 5yr train, 2yr test): 14 of 15 folds profitable out-of-sample. Mean OOS CAGR of 8.9% with a 0.90 Sharpe.. actually higher than in-sample. Zero overfitting signal.


The Trading Reality

38 trades in 26 years = ~1.5 trades per year.

Average hold time: 157 days (about 5 months).

This isn’t day trading. This isn’t even swing trading. This is macro positioning.

You could run this system with a full-time job. You could run it while traveling. You get an alert when the regime flips. You execute the trade. You go back to your life.

That’s it.


Signal #37: The First Live Test

I launched the Macro Regime Engine live in January 2026.

Two months later, it issued its first live risk-off signal. Signal #37. Paid subscribers had it before markets closed. The portfolio shifted to cash. No panic. No guessing. Just the regime flipping, exactly as designed.

That signal came after 26 years of backtested history spanning every major crisis in modern markets.. and it fired in real-time, in front of a live audience, with real money on the line.

The MRE is now fully risk-off. 100% cash / $USFR. The system and 42Macro’s research are in agreement as of this writing: bearish macro regime.

We wait. We preserve capital. We stay ready to buy the ashes when the signal flips back.


The Full Arsenal

The Macro Regime Engine handles equities. But that’s one system.

For Bitcoin & (Gold) , I built a separate engine: The 8th Rule.. a dual-speed Gaussian volatility trend system. Where the MRE polls 20+ global assets, The 8th Rule runs two independent signal engines at different speeds on the underlying asset itself.

A fast entry system catches trend flips within days. A slow confirmation system validates the move. Dynamic position sizing bridges the gap.

8th rule screenshot circa late March 2026

The two systems have low correlation. When the MRE is flat (risk-off for equities), BTC or Gold might be in a completely different regime.

Paid subscribers get signals from both systems.

Subscribe now


What Could Go Wrong (Read This)

I’m going to be upfront about the limitations because I think that matters more than another flex.

38 trades is a thin sample. A 74% win rate with 38 observations has a wide statistical confidence interval. The system could have a 60% true win rate or a 90% true win rate and both would be consistent with the observed data.

I believe the edge is real because the thesis is sound, the Monte Carlo confirms robustness, and the track record spans every major regime type.. but I can’t prove it with the statistical confidence a 500-trade system would offer.

The macro framework assumes stable asset relationships. The engine’s logic assumes equities rally in Goldilocks, the dollar strengthens in Deflation, volatility spikes during stress.

These relationships have held for decades. But they’re not physical laws. A structural shift in how markets price risk could degrade accuracy.

Backtests always look better than reality. The system uses realistic assumptions ($1/trade, 1-tick slippage) and non-repainting logic, which helps. But execution slippage, data feed differences, and the messy reality of trading around holidays will introduce friction.

Treat the 14.78 profit factor as the ceiling, not the floor.

Regime changes can be late. The confirmation filter that prevents whipsaw also introduces delay. The Feb 2020 exit happened the week before the crash, not the month before. In a faster crash, the delay could be costlier.

This is not a holy grail. This is a macro-aware binary overlay.. a seatbelt to the market. If the cost of avoiding catastrophic accidents is occasionally missing a sunny Sunday drive, I’ll live.


What I’ve Shipped Since Launch

This isn’t a static system. I’m building in public, testing, iterating, publishing.

Delivered:

In development:

I publish the research, the reasoning, and most importantly.. the receipts.


The Philosophy

The point of this whole project isn’t to “beat the market.”

If you want max upside and max pain, you can just buy SPX, never look at a chart again, and let the Fed do whatever it does between now and 2060.

The point is to have system-driven rules for when the world changes.

When bond vol is breaking out, I want less equity exposure and more capital ready to buy blood. When commodities and breakevens catch a bid, I want to respect that inflation isn’t “transitory” just because a press release said so. When growth, credit, and FX all agree the party’s back on, I want to be long...

That’s what the Macro Regime Engine is: a way to translate a chaotic macro tape into a simple question:

“Is this a time to survive, or a time to press?”

You don’t need to predict what Powell will say next month. You don’t need to guess if we’re in a recession. You don’t need to time every move perfectly.

You just need to know what regime we’re in right now.. and position accordingly.

Survival is alpha.

— Durden out. ✊🧼


Last updated: March 2026. All performance figures re-audited against TradingView backtest export on CME E-mini S&P 500 futures (ES1!) from August 1999 through March 2026. $1M initial capital, $1 commission, 1-tick slippage. Non-repainting.

Not financial advice. Trading equities and futures involves substantial risk of loss. Past performance does not guarantee future results. Backtested performance has inherent limitations and does not reflect actual trading. The author is not a licensed financial advisor. Always do your own research and consult a qualified professional before making investment decisions. You are solely responsible for your own trading decisions.

Manage risk. The market’s real engine is liquidity.

Want the live dashboards behind these insights?

Free subscribers get research updates. Paid subscribers get live macro tools + signal alerts.