Mira Risk Engine

Official report: detect risk, size it, act. Backtest 2001-2026 and strict 2025-2026 test.
Version 1.0, 2026-10-15. Project: Mira (U-Hackathon Flow Summit). Research only. No real money. Not investment advice.
Read first. This is a historical backtest with a fixed rule set. It is not a forecast and not a promise of return. Markets can fall further than any past period. For real money, speak to a licensed adviser.

1. Summary

-8%worst fall, Mira chain 60%, vs -33% fixed and -51% all-stocks
+5.9%growth a year, Mira chain 60% (fixed +6.2%, all-stocks +8.8%)
0.76Sharpe over cash (fixed 0.52)
5 of 26calendar years the chain beat fixed 60%

The engine watches the S&P 500 for three danger signs, estimates how bad one month could be, and lowers the stock share when risk is high. Over 25 years it kept a growth rate close to a fixed 60% stock mix while avoiding the deepest falls. In the calm 2025-2026 window it gave up growth because there was little to protect against.

Best points: shallow falls in the dot-com bust, the 2008 crisis and Covid; a high Sharpe ratio; it works with a plain cash fallback; the rules are simple enough to explain to a first-time investor.
Weak points: it sometimes cuts stocks just before a rebound (April 2025, March 2026); it cannot see a sudden fall that starts from a calm market; its edge is avoiding deep falls, not extra return.

2. How it works

StepWhat it doesRule (fixed before testing)
1 DetectThree alarms on the S&P 500 at month end20-day volatility > 1.5 x 250-day; drawdown ≥ 10% from the 1-year high; price below the 200-day average. Stress = number of alarms (0-3)
2 SizeOne bad month at 95% confidence1.645 x the higher of 20/60-day volatility x √21. Stock share allowed by a 4% monthly risk budget
3 ActStock share = lower of base dial and risk-budget share, times a gateGate by stress: 0 = 100%, 1 = 75%, 2 = 50%, 3 = 25%. The rest sits in cash (long test) or a defensive multi-asset core

Costs: 10 basis points on every change. Decisions at month end use only data known then; money works the next month. Leak test: 12 of 12 random months gave the identical signal with future prices removed.

3. Results, 2001-2026 (S&P 500 total return + cash)

Growth of 100. The chain (green) stays close to the fixed mix and avoids the deepest falls.
Growth of 100. The chain (green) stays close to the fixed mix and avoids the deepest falls.
60% baseGrowth a yearVolatilitySharpeWorst fallWorst 12 monthsUp months100 becomes
S&P 500 (100% stocks)+8.8%15.1%0.52-50.8%-43.4%65%881
Fixed 60% stocks+6.2%9.0%0.52-33.4%-28.0%66%474
Trend dial 60%+6.6%6.6%0.74-11.9%-8.4%75%515
Risk gate 60%+6.6%6.5%0.75-16.9%-12.0%66%520
Mira chain 60% (detect-size-act)+5.9%5.5%0.76-7.7%-6.4%66%435
cash+1.8%0.5%nan+0.0%+0.0%100%157
30% baseGrowth a yearVolatilitySharpeWorst fallWorst 12 monthsUp months100 becomes
Fixed 30% stocks+4.1%4.5%0.52-17.3%-14.4%66%280
Risk gate 30%+4.2%3.3%0.74-7.8%-5.6%68%290
Mira chain 30% (detect-size-act)+4.2%3.2%0.75-5.5%-4.2%68%287
Drawdown. The chain falls far less than all-stocks or fixed 60% in every crisis.
Drawdown. The chain falls far less than all-stocks or fixed 60% in every crisis.
Growth against worst fall. Top-right is better.
Growth against worst fall. Top-right is better.

4. Returns by year and by month

Annual return by calendar year: all-stocks, fixed 60% and Mira chain 60%.
Annual return by calendar year: all-stocks, fixed 60% and Mira chain 60%.
YearS&P 500Fixed 60%Gate 60%Mira chain 60%
2001 (Feb-Dec)-15.5%-8.1%-2.5%-1.5%
2002-21.6%-12.6%-6.5%-4.2%
2003+28.2%+16.8%+14.4%+11.8%
2004+10.7%+6.9%+6.5%+6.7%
2005+4.8%+4.2%+4.2%+3.8%
2006+15.8%+11.3%+11.3%+11.3%
2007+5.1%+5.0%+4.7%+4.4%
2008-36.8%-23.0%-9.8%-4.9%
2009+26.4%+15.8%+12.2%+7.8%
2010+15.1%+9.3%+7.6%+6.0%
2011+1.9%+1.4%+1.3%+0.3%
2012+16.0%+9.5%+8.7%+6.5%
2013+32.3%+18.5%+18.5%+17.7%
2014+13.5%+8.0%+7.5%+7.2%
2015+1.2%+0.9%+0.4%-0.9%
2016+12.0%+7.3%+7.1%+6.0%
2017+21.7%+13.0%+13.0%+13.0%
2018-4.6%-1.8%-0.6%+0.3%
2019+31.2%+19.0%+13.2%+10.7%
2020+18.3%+11.6%+10.3%+2.3%
2021+28.7%+16.6%+16.6%+15.6%
2022-18.2%-10.2%-8.8%-5.5%
2023+26.2%+17.6%+13.8%+12.9%
2024+24.9%+16.7%+16.7%+16.5%
2025+17.7%+12.2%+10.5%+6.8%
2026 (Jan-Sep)+12.7%+8.8%+7.2%+5.8%

Worst calendar year: all-stocks -36.8%, Mira chain -5.5%.

Month-by-month returns of the Mira chain (60% base). Green = gain, red = loss.
Month-by-month returns of the Mira chain (60% base). Green = gain, red = loss.
Same view for the fixed 60% mix, for comparison.
Same view for the fixed 60% mix, for comparison.

5. Crises and what the detector saw

Cumulative return in each crisis, 60% base.
Cumulative return in each crisis, 60% base.
Crisis, cumulative returnFixed 60%Gate 60%Mira chain 60%
Dot-com 2001-01..2002-10-16.9%-7.3%-5.0%
GFC 2007-10..2009-03-25.9%-12.2%-6.0%
Covid 2020-01..03-5.1%-4.7%-5.4%
2022 bear 2021-12..2022-10-7.1%-6.6%-4.5%
Stress level (0-3) at each month end under the S&P 500 total return. Darker = more alarms.
Stress level (0-3) at each month end under the S&P 500 total return. Darker = more alarms.

Stress 2 or 3 came before 11 of the 13 one-month falls of 8% or more. After stress 3, the next month fell 5% or more in 46% of months (13 months, a small sample). Stress is a volatility-regime gauge, not a crash forecast: falls that start from a calm market are not seen in time.

6. Strict test, 2025-2026

Decisions from January 2025, after the training cutoff of the AI model used elsewhere in the project. Signals were checked for look-ahead. Defensive side: the multi-asset core. 19 months.

60% baseGrowth a yearWorst fallSharpe
Fixed 60% stocks+12.5%-4.0%1.03
Risk gate 60%+10.4%-3.9%0.90
Mira chain 60% (detect-size-act)+7.5%-3.8%0.59

The market was calm; the worst fall for the fixed mix was about -4%. The declared success rule is inconclusive. The gate lowered growth because it cut stocks in April 2025 and March 2026, before rebounds.

7. Honest limits

8. Forward test (pre-registered)

The rule was frozen on 2026-10-15 with a code hash and a monthly ledger. Decisions logged so far: 1. A verdict needs 12 scored months and starts from October 2026 returns. A code change makes the program refuse to run.

9. Reproduce

Code and data snapshot: risk-system_SNAPSHOT_2026-10-15_mira.zip. Commands: python -E mira_invest.py, python -E mira_sandbox_tests.py, python -E mira_official_report.py. Tests: 19 suites, all passing.