MACDMomentum_V0370
ARCHIVEDhybridllm1) Added regime gates: allow only UPTREND/SIDEWAYS and avoid HIGH_VOLATILITY/EXTREME bubble to reduce drawdowns. 2) Tightened entry: require momentum (macd_hist>0 & price>sma50) to also have sma50>sma200 OR a true breakout with elevated volume; added vol_pctile<0.8 gate to avoid entries in very high-volatility regimes. 3) Improved exits: keep macd_hist<0 but add price crossing below sma50 and a hard drawdown stop (12%). 4) Added position sizing rules: full size on high-volume breakouts (rel_volume>1.5), de-risk to 0.4 in very high vol; reduced base position to 0.6. Aim: better regime awareness, clearer breakout sizing, and stronger exits to improve validation robustness.
Lineage
entry = MACDMomentum_V0005 OR VolumeBreakout_V0185
Strategy Logic (pseudocode)
# MACDMomentum_V0370 [hybrid]
require regime.trend in ['UPTREND', 'SIDEWAYS']
require regime.volatility in ['LOW_VOLATILITY', 'MEDIUM_VOLATILITY']
require regime.bubble in ['NORMAL', 'EXPENSIVE']
if flat and (((macd_hist > 0.0 and close > sma_50 and sma_50 > sma_200) or (breakout_50 == 1 and rel_volume > 1.2)) and vol_pctile < 0.8):
position = 0.6
if long and (macd_hist < 0.0 or close < sma_50 or drawdown > 0.12):
position = 0.0 # exit to cashBacktest Metrics
| Metric | Train | Validation | Hidden Test | Full |
|---|---|---|---|---|
| CAGR | 3.6% | 21.1% | -0.4% | 6.1% |
| Total Return | 33.1% | 77.8% | -1.5% | 137.1% |
| Sharpe | 0.38 | 1.37 | 0.02 | 0.55 |
| Sortino | 0.25 | 1.09 | 0.01 | 0.37 |
| Calmar | 0.19 | 1.73 | -0.02 | 0.26 |
| Volatility | 11.1% | 14.8% | 11.0% | 12.0% |
| Max DD | -19.6% | -12.2% | -23.1% | -23.1% |
| Win Rate | 37.7% | 44.4% | 30.0% | 37.4% |
| Avg Win | 4.8% | 10.2% | 6.0% | 6.7% |
| Avg Loss | -2.2% | -1.8% | -2.5% | -2.2% |
| Payoff | 2.21 | 5.73 | 2.38 | 3.04 |
| Expectancy | 0.5% | 3.5% | 0.0% | 1.1% |
| Profit Factor | 1.34 | 4.58 | 1.02 | 1.82 |
| Trades | 53 | 18 | 20 | 91 |
| Avg Holding Days | 7.1 | 9.4 | 7.4 | 7.8 |
| Turnover | 8.0 | 7.2 | 6.5 | 7.4 |
| Exposure | 10.0% | 12.1% | 8.2% | 10.0% |
Growth of $100
Walk-Forward Years
| Year | CAGR | Sharpe | Max DD | Trades |
|---|---|---|---|---|
| 2016 | 0.6% | 0.14 | -4.0% | 3 |
| 2017 | 13.8% | 1.21 | -7.6% | 14 |
| 2018 | -4.4% | -0.85 | -5.5% | 4 |
| 2019 | 10.6% | 0.76 | -9.1% | 2 |
| 2020 | 40.2% | 2.24 | -5.3% | 6 |
| 2021 | 20.1% | 1.14 | -12.2% | 9 |
| 2022 | 5.6% | 0.57 | -9.1% | 2 |
A robust strategy performs acceptably in most years rather than spectacularly in one — look for consistency across regimes, not a single outlier year.
Regime Performance
| Period | Regime | Days | Ann. Return | Sharpe | Exposure |
|---|---|---|---|---|---|
| hidden test | DOWNTREND | 267 | 0.0% | 0.00 | 0% |
| hidden test | EXPENSIVE | 83 | 19.4% | 1.28 | 12% |
| hidden test | EXTREME | 48 | 0.0% | 0.00 | 0% |
| hidden test | HIGH VOLATILITY | 254 | -5.9% | -0.69 | 1% |
| hidden test | LOW VOLATILITY | 429 | 7.6% | 0.67 | 12% |
| hidden test | MEDIUM VOLATILITY | 248 | -6.5% | -0.52 | 9% |
| hidden test | NORMAL | 800 | -1.8% | -0.17 | 8% |
| hidden test | SIDEWAYS | 293 | -21.2% | -2.22 | 11% |
| hidden test | UPTREND | 371 | 17.2% | 1.13 | 12% |
| train | DOWNTREND | 518 | -0.6% | -0.77 | 0% |
| train | EXPENSIVE | 311 | 29.2% | 1.97 | 17% |
| train | EXTREME | 100 | 7.0% | 1.55 | 1% |
| train | HIGH VOLATILITY | 699 | 8.6% | 0.73 | 1% |
| train | LOW VOLATILITY | 745 | 11.9% | 1.12 | 19% |
| train | MEDIUM VOLATILITY | 568 | -11.2% | -1.03 | 10% |
| train | NORMAL | 1,601 | -0.8% | -0.08 | 9% |
| train | SIDEWAYS | 592 | -9.1% | -0.89 | 9% |
| train | UPTREND | 902 | 15.7% | 1.10 | 16% |
| validation | DOWNTREND | 125 | 0.0% | 0.00 | 0% |
| validation | EXPENSIVE | 138 | 65.7% | 3.13 | 20% |
| validation | EXTREME | 144 | 23.1% | 2.28 | 1% |
| validation | HIGH VOLATILITY | 258 | -7.1% | -1.00 | 0% |
| validation | LOW VOLATILITY | 183 | 14.1% | 1.39 | 19% |
| validation | MEDIUM VOLATILITY | 315 | 46.3% | 2.26 | 18% |
| validation | NORMAL | 474 | 6.2% | 0.45 | 13% |
| validation | SIDEWAYS | 206 | 4.1% | 0.34 | 12% |
| validation | UPTREND | 425 | 34.1% | 1.91 | 16% |
Trades (full period)
| Entry | Exit | Entry Px | Exit Px | Return | Days | |
|---|---|---|---|---|---|---|
| 2026-05-12 | 2026-05-21 | $433.45 | $417.85 | -3.84% | 8 | |
| 2025-12-04 | 2025-12-30 | $454.53 | $454.43 | 1.72% | 18 | |
| 2025-11-04 | 2025-11-05 | $444.26 | $462.07 | -3.21% | 2 | |
| 2025-09-12 | 2025-10-06 | $395.94 | $453.25 | 9.73% | 17 | |
| 2025-07-29 | 2025-07-30 | $321.20 | $319.04 | -0.93% | 2 | |
| 2025-07-21 | 2025-07-25 | $328.49 | $316.06 | -4.53% | 5 | |
| 2024-09-23 | 2024-10-04 | $250.00 | $250.08 | 0.56% | 10 | |
| 2024-09-16 | 2024-09-20 | $226.78 | $238.25 | 3.45% | 5 | |
| 2024-09-06 | 2024-09-09 | $210.73 | $216.27 | -5.18% | 2 | |
| 2024-06-27 | 2024-07-12 | $197.42 | $248.23 | 13.31% | 11 | |
| 2023-12-15 | 2024-01-02 | $253.50 | $248.42 | -0.67% | 11 | |
| 2023-11-29 | 2023-12-14 | $244.14 | $251.05 | -1.92% | 12 | |
| 2023-11-22 | 2023-11-24 | $234.21 | $235.45 | -1.86% | 2 | |
| 2023-11-16 | 2023-11-17 | $233.59 | $234.30 | -2.40% | 2 | |
| 2023-10-06 | 2023-10-17 | $260.53 | $254.85 | -1.52% | 8 | |
| 2023-09-12 | 2023-09-22 | $267.48 | $244.88 | -4.05% | 9 | |
| 2023-09-06 | 2023-09-07 | $251.92 | $251.49 | -1.19% | 2 | |
| 2023-08-30 | 2023-09-05 | $256.90 | $256.49 | -2.95% | 4 | |
| 2023-07-06 | 2023-07-07 | $276.54 | $274.43 | -1.38% | 2 | |
| 2023-06-05 | 2023-06-27 | $217.61 | $250.21 | 7.51% | 16 | |
| 2022-08-02 | 2022-08-12 | $300.59 | $300.03 | -2.19% | 9 | |
| 2022-03-21 | 2022-04-11 | $307.05 | $325.31 | 7.90% | 16 | |
| 2021-12-28 | 2022-01-03 | $362.82 | $399.93 | -2.17% | 5 | |
| 2021-10-13 | 2021-11-10 | $270.36 | $355.98 | 15.97% | 21 | |
| 2021-10-08 | 2021-10-11 | $261.83 | $263.98 | -0.73% | 2 | |
| 2021-09-27 | 2021-10-07 | $263.79 | $264.54 | 0.54% | 9 | |
| 2021-08-31 | 2021-09-21 | $245.24 | $246.46 | -0.14% | 15 | |
| 2021-08-03 | 2021-08-17 | $236.58 | $221.90 | -2.08% | 11 | |
| 2021-06-24 | 2021-07-12 | $226.61 | $228.57 | -0.04% | 12 | |
| 2021-04-14 | 2021-04-29 | $244.08 | $225.67 | -5.47% | 12 | |
| 2021-01-12 | 2021-01-25 | $283.15 | $293.60 | 2.52% | 9 | |
| 2021-01-05 | 2021-01-11 | $245.04 | $270.40 | 11.92% | 5 | |
| 2020-12-18 | 2020-12-23 | $231.67 | $215.33 | -1.45% | 4 | |
| 2020-12-10 | 2020-12-17 | $209.02 | $218.63 | 1.74% | 6 | |
| 2020-11-18 | 2020-12-08 | $162.21 | $216.63 | 25.43% | 14 | |
| 2020-11-09 | 2020-11-10 | $140.42 | $136.79 | -1.33% | 2 | |
| 2020-10-14 | 2020-10-20 | $153.77 | $140.65 | -2.23% | 5 | |
| 2019-12-16 | 2020-01-22 | $25.43 | $37.97 | 29.23% | 25 | |
| 2019-10-15 | 2019-10-25 | $17.19 | $21.88 | 9.89% | 9 | |
| 2019-07-25 | 2019-07-26 | $15.25 | $15.20 | -8.28% | 2 | |
| 2018-12-11 | 2018-12-18 | $24.45 | $22.47 | -2.84% | 6 | |
| 2018-12-07 | 2018-12-10 | $23.86 | $24.34 | -0.96% | 2 | |
| 2018-12-04 | 2018-12-06 | $23.98 | $24.20 | 0.08% | 2 | |
| 2018-01-18 | 2018-02-05 | $22.97 | $22.21 | -0.67% | 13 | |
| 2017-12-12 | 2017-12-26 | $22.74 | $21.15 | -0.76% | 10 | |
| 2017-10-18 | 2017-10-20 | $23.98 | $23.01 | -0.78% | 3 | |
| 2017-10-12 | 2017-10-17 | $23.71 | $23.72 | -0.79% | 4 | |
| 2017-09-12 | 2017-09-25 | $24.18 | $23.00 | -2.16% | 10 | |
| 2017-08-15 | 2017-08-18 | $24.16 | $23.16 | -2.08% | 4 | |
| 2017-08-04 | 2017-08-07 | $23.79 | $23.68 | 1.58% | 2 | |
| 2017-06-05 | 2017-06-14 | $23.15 | $25.38 | 6.18% | 8 | |
| 2017-05-15 | 2017-05-16 | $21.06 | $21.13 | -1.77% | 2 | |
| 2017-05-02 | 2017-05-04 | $21.26 | $19.70 | -2.32% | 3 | |
| 2017-04-20 | 2017-04-21 | $20.17 | $20.37 | -0.71% | 2 | |
| 2017-03-24 | 2017-04-04 | $17.54 | $20.25 | 9.94% | 8 | |
| 2017-03-20 | 2017-03-22 | $17.46 | $17.00 | -2.60% | 3 | |
| 2017-02-10 | 2017-02-22 | $17.95 | $18.23 | 1.74% | 8 | |
| 2016-12-28 | 2017-02-02 | $14.65 | $16.77 | 7.86% | 25 | |
| 2016-07-22 | 2016-08-09 | $14.82 | $15.27 | 1.45% | 13 | |
| 2016-06-08 | 2016-06-10 | $15.70 | $14.59 | -0.88% | 3 | |
| 2016-04-05 | 2016-04-14 | $17.03 | $16.79 | 1.76% | 8 | |
| 2015-12-31 | 2016-01-05 | $16.00 | $14.90 | -3.80% | 3 | |
| 2015-09-21 | 2015-09-29 | $17.61 | $16.44 | -2.92% | 7 | |
| 2015-07-21 | 2015-07-22 | $17.78 | $17.86 | -3.41% | 2 | |
| 2015-06-22 | 2015-07-09 | $17.32 | $17.19 | -1.76% | 13 | |
| 2015-06-18 | 2015-06-19 | $17.46 | $17.50 | 0.22% | 2 | |
| 2015-06-09 | 2015-06-10 | $17.07 | $16.71 | -0.19% | 2 | |
| 2015-04-28 | 2015-05-22 | $15.37 | $16.52 | 3.52% | 19 | |
| 2014-11-25 | 2014-12-01 | $16.54 | $15.44 | -0.65% | 4 | |
| 2014-11-12 | 2014-11-24 | $16.61 | $16.45 | -2.07% | 9 | |
| 2014-10-08 | 2014-10-10 | $17.29 | $15.79 | -0.71% | 3 | |
| 2014-09-02 | 2014-09-12 | $18.94 | $18.61 | 2.28% | 9 | |
| 2014-07-31 | 2014-08-25 | $14.89 | $17.50 | 7.10% | 18 | |
| 2014-06-16 | 2014-07-07 | $14.97 | $14.84 | 6.53% | 15 | |
| 2014-06-12 | 2014-06-13 | $13.57 | $13.76 | -0.40% | 2 | |
| 2014-06-06 | 2014-06-11 | $13.88 | $13.63 | -1.45% | 4 | |
| 2014-05-28 | 2014-06-03 | $14.02 | $13.66 | -2.07% | 5 | |
| 2014-02-13 | 2014-02-26 | $13.31 | $16.87 | 15.66% | 9 | |
| 2014-01-03 | 2014-01-10 | $9.97 | $9.71 | -1.13% | 6 | |
| 2013-09-20 | 2013-10-04 | $12.23 | $12.07 | -1.58% | 11 | |
| 2013-09-09 | 2013-09-10 | $10.71 | $11.09 | -2.37% | 2 | |
| 2013-03-27 | 2013-04-02 | $2.54 | $2.96 | 9.49% | 4 | |
| 2013-03-08 | 2013-03-18 | $2.56 | $2.34 | -4.74% | 7 | |
| 2013-01-23 | 2013-02-14 | $2.40 | $2.55 | 5.39% | 17 | |
| 2012-11-20 | 2012-12-14 | $2.20 | $2.25 | 1.20% | 18 | |
| 2012-07-17 | 2012-07-23 | $2.22 | $2.04 | -7.16% | 5 | |
| 2012-06-27 | 2012-07-03 | $2.13 | $2.04 | -2.42% | 5 | |
| 2012-06-19 | 2012-06-25 | $2.14 | $2.21 | 3.60% | 5 | |
| 2012-03-27 | 2012-04-05 | $2.53 | $2.30 | -3.91% | 8 | |
| 2012-03-13 | 2012-03-16 | $2.41 | $2.35 | -1.80% | 4 | |
| 2012-02-15 | 2012-02-29 | $2.24 | $2.23 | 1.06% | 10 |