MACDMomentum_V0703
ARCHIVEDhybridllm1) Added regime gates: only trade in UPTREND or SIDEWAYS and avoid HIGH_VOLATILITY; exclude EXTREME bubble. 2) Tightened entry: require MACD histogram positive, positive 60-day momentum, price above SMA50, plus either SMA50>200 (trend) or a true breakout with elevated relative volume — reduces false signals. 3) Improved exit: exit on MACD flip, price dropping below SMA20 (faster trend failure), or if drawdown >8% (risk control). 4) Position sizing rules: scale down size when volatility percentile is elevated (vol_pctile>0.6 and >0.8) to reduce risk in turbulent regimes. 5) Reduced base_position to 0.8 for overall risk management. These changes favor regime-aware, volatility-adjusted entries/exits to improve generalization and reduce drawdowns.
Lineage
changed rel_volume threshold 1.5045 -> 1.0207
Strategy Logic (pseudocode)
# MACDMomentum_V0703 [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 momentum_60 > 0.0 and close > sma_50 and (sma_50 > sma_200 or (breakout_50 == 1 and rel_volume > 1.15))):
position = 0.8
if long and (macd_hist < 0.0 or close < sma_20 or drawdown > 0.08):
position = 0.0 # exit to cashBacktest Metrics
| Metric | Train | Validation | Hidden Test | Full |
|---|---|---|---|---|
| CAGR | 1.1% | 30.3% | 4.1% | 7.4% |
| Total Return | 9.3% | 121.1% | 16.0% | 186.9% |
| Sharpe | 0.15 | 1.48 | 0.33 | 0.55 |
| Sortino | 0.08 | 1.17 | 0.20 | 0.33 |
| Calmar | 0.05 | 1.89 | 0.23 | 0.30 |
| Volatility | 13.0% | 19.1% | 15.5% | 15.1% |
| Max DD | -24.5% | -16.0% | -18.0% | -24.5% |
| Win Rate | 35.1% | 43.8% | 40.0% | 38.2% |
| Avg Win | 7.6% | 15.3% | 8.5% | 10.6% |
| Avg Loss | -3.9% | -1.9% | -3.6% | -3.4% |
| Payoff | 1.93 | 8.18 | 2.37 | 3.11 |
| Expectancy | 0.1% | 5.6% | 1.2% | 1.9% |
| Profit Factor | 1.05 | 6.36 | 1.58 | 1.92 |
| Trades | 37 | 16 | 15 | 68 |
| Avg Holding Days | 7.5 | 8.9 | 9.7 | 8.5 |
| Turnover | 7.5 | 8.5 | 6.5 | 7.4 |
| Exposure | 10.0% | 13.4% | 11.2% | 11.0% |
Growth of $100
Walk-Forward Years
| Year | CAGR | Sharpe | Max DD | Trades |
|---|---|---|---|---|
| 2016 | -7.7% | -0.96 | -12.8% | 3 |
| 2017 | 14.4% | 1.02 | -11.8% | 13 |
| 2018 | -3.8% | -0.75 | -6.1% | 1 |
| 2019 | 0.7% | 0.12 | -11.0% | 1 |
| 2020 | 56.0% | 2.24 | -7.1% | 6 |
| 2021 | 34.4% | 1.45 | -16.0% | 8 |
| 2022 | -5.0% | -0.66 | -8.5% | 1 |
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 | 271 | 0.0% | 0.00 | 0% |
| hidden test | EXPENSIVE | 83 | 25.9% | 1.28 | 16% |
| hidden test | EXTREME | 48 | 0.0% | 0.00 | 0% |
| hidden test | HIGH VOLATILITY | 254 | -7.8% | -0.69 | 1% |
| hidden test | LOW VOLATILITY | 431 | 16.3% | 1.06 | 16% |
| hidden test | MEDIUM VOLATILITY | 250 | -0.7% | -0.04 | 13% |
| hidden test | NORMAL | 804 | 3.4% | 0.22 | 11% |
| hidden test | SIDEWAYS | 293 | -14.3% | -0.91 | 15% |
| hidden test | UPTREND | 371 | 24.4% | 1.20 | 16% |
| train | DOWNTREND | 518 | 0.0% | 0.00 | 0% |
| train | EXPENSIVE | 311 | 32.9% | 1.69 | 21% |
| train | EXTREME | 100 | 9.3% | 1.55 | 1% |
| train | HIGH VOLATILITY | 699 | 6.1% | 0.48 | 1% |
| train | LOW VOLATILITY | 745 | 10.8% | 0.85 | 21% |
| train | MEDIUM VOLATILITY | 568 | -14.8% | -1.09 | 8% |
| train | NORMAL | 1,601 | -4.5% | -0.39 | 9% |
| train | SIDEWAYS | 592 | -15.1% | -1.51 | 4% |
| train | UPTREND | 902 | 14.3% | 0.81 | 20% |
| validation | DOWNTREND | 125 | 0.0% | 0.00 | 0% |
| validation | EXPENSIVE | 138 | 87.6% | 3.13 | 27% |
| validation | EXTREME | 144 | 30.7% | 2.28 | 2% |
| validation | HIGH VOLATILITY | 258 | 1.0% | 0.07 | 1% |
| validation | LOW VOLATILITY | 183 | 16.3% | 1.22 | 25% |
| validation | MEDIUM VOLATILITY | 315 | 57.4% | 2.34 | 17% |
| validation | NORMAL | 474 | 10.2% | 0.59 | 13% |
| validation | SIDEWAYS | 206 | -0.8% | -0.14 | 6% |
| validation | UPTREND | 425 | 50.6% | 2.02 | 21% |
Trades (full period)
| Entry | Exit | Entry Px | Exit Px | Return | Days | |
|---|---|---|---|---|---|---|
| 2026-05-12 | 2026-05-21 | $433.45 | $417.85 | -5.13% | 8 | |
| 2025-12-04 | 2025-12-30 | $454.53 | $454.43 | 2.22% | 18 | |
| 2025-11-04 | 2025-11-05 | $444.26 | $462.07 | -4.27% | 2 | |
| 2025-09-12 | 2025-10-06 | $395.94 | $453.25 | 13.02% | 17 | |
| 2025-07-29 | 2025-08-01 | $321.20 | $302.63 | -4.42% | 4 | |
| 2025-07-21 | 2025-07-25 | $328.49 | $316.06 | -6.05% | 5 | |
| 2024-09-23 | 2024-10-04 | $250.00 | $250.08 | 0.70% | 10 | |
| 2024-09-16 | 2024-09-20 | $226.78 | $238.25 | 4.58% | 5 | |
| 2024-09-06 | 2024-09-09 | $210.73 | $216.27 | -6.91% | 2 | |
| 2024-06-27 | 2024-07-12 | $197.42 | $248.23 | 17.87% | 11 | |
| 2023-12-19 | 2024-01-02 | $257.22 | $248.42 | -1.26% | 9 | |
| 2023-11-16 | 2023-12-13 | $233.59 | $239.29 | -2.03% | 19 | |
| 2023-08-30 | 2023-09-22 | $256.90 | $244.88 | -0.48% | 17 | |
| 2023-07-06 | 2023-07-07 | $276.54 | $274.43 | -1.84% | 2 | |
| 2023-06-02 | 2023-06-27 | $213.97 | $250.21 | 12.72% | 17 | |
| 2022-03-29 | 2022-04-11 | $366.52 | $325.31 | -4.98% | 10 | |
| 2021-12-28 | 2022-01-04 | $362.82 | $383.20 | 7.63% | 6 | |
| 2021-10-13 | 2021-11-10 | $270.36 | $355.98 | 21.37% | 21 | |
| 2021-10-08 | 2021-10-11 | $261.83 | $263.98 | -0.98% | 2 | |
| 2021-09-28 | 2021-10-07 | $259.19 | $264.54 | -1.03% | 8 | |
| 2021-08-31 | 2021-09-21 | $245.24 | $246.46 | -0.21% | 15 | |
| 2021-08-03 | 2021-08-17 | $236.58 | $221.90 | -2.79% | 11 | |
| 2021-06-24 | 2021-07-12 | $226.61 | $228.57 | -0.08% | 12 | |
| 2021-01-12 | 2021-01-25 | $283.15 | $293.60 | 3.35% | 9 | |
| 2021-01-05 | 2021-01-11 | $245.04 | $270.40 | 16.09% | 5 | |
| 2020-12-18 | 2020-12-23 | $231.67 | $215.33 | -1.99% | 4 | |
| 2020-12-10 | 2020-12-17 | $209.02 | $218.63 | 2.29% | 6 | |
| 2020-11-18 | 2020-12-08 | $162.21 | $216.63 | 34.96% | 14 | |
| 2020-11-09 | 2020-11-10 | $140.42 | $136.79 | -1.78% | 2 | |
| 2020-10-14 | 2020-10-20 | $153.77 | $140.65 | -2.98% | 5 | |
| 2019-12-16 | 2020-01-22 | $25.43 | $37.97 | 40.42% | 25 | |
| 2019-07-25 | 2019-07-26 | $15.25 | $15.20 | -11.04% | 2 | |
| 2018-12-11 | 2018-12-18 | $24.45 | $22.47 | -3.81% | 6 | |
| 2017-10-18 | 2017-10-23 | $23.98 | $22.47 | -2.55% | 4 | |
| 2017-10-12 | 2017-10-17 | $23.71 | $23.72 | -1.06% | 4 | |
| 2017-09-15 | 2017-09-25 | $25.32 | $23.00 | -5.79% | 7 | |
| 2017-08-15 | 2017-08-18 | $24.16 | $23.16 | -2.77% | 4 | |
| 2017-08-04 | 2017-08-07 | $23.79 | $23.68 | 2.10% | 2 | |
| 2017-06-05 | 2017-06-14 | $23.15 | $25.38 | 8.28% | 8 | |
| 2017-05-15 | 2017-05-16 | $21.06 | $21.13 | -2.36% | 2 | |
| 2017-05-02 | 2017-05-04 | $21.26 | $19.70 | -3.09% | 3 | |
| 2017-04-20 | 2017-04-21 | $20.17 | $20.37 | -0.95% | 2 | |
| 2017-03-24 | 2017-04-04 | $17.54 | $20.25 | 13.40% | 8 | |
| 2017-03-20 | 2017-03-22 | $17.46 | $17.00 | -3.46% | 3 | |
| 2017-02-10 | 2017-02-22 | $17.95 | $18.23 | 2.29% | 8 | |
| 2016-12-28 | 2017-02-02 | $14.65 | $16.77 | 10.56% | 25 | |
| 2016-08-01 | 2016-08-09 | $15.33 | $15.27 | -3.10% | 7 | |
| 2016-06-08 | 2016-06-13 | $15.70 | $14.52 | -4.82% | 4 | |
| 2016-04-05 | 2016-04-14 | $17.03 | $16.79 | 2.32% | 8 | |
| 2015-07-21 | 2015-07-22 | $17.78 | $17.86 | -4.55% | 2 | |
| 2015-06-22 | 2015-07-09 | $17.32 | $17.19 | -2.40% | 13 | |
| 2015-04-28 | 2015-05-22 | $15.37 | $16.52 | 4.69% | 19 | |
| 2014-11-17 | 2014-11-24 | $16.93 | $16.45 | -5.08% | 6 | |
| 2014-10-08 | 2014-10-13 | $17.29 | $14.97 | -7.15% | 4 | |
| 2014-09-02 | 2014-09-12 | $18.94 | $18.61 | 3.01% | 9 | |
| 2014-07-31 | 2014-08-25 | $14.89 | $17.50 | 9.51% | 18 | |
| 2014-06-18 | 2014-07-07 | $15.14 | $14.84 | -0.96% | 13 | |
| 2014-02-13 | 2014-02-26 | $13.31 | $16.87 | 21.13% | 9 | |
| 2013-09-23 | 2013-10-04 | $12.07 | $12.07 | -4.52% | 10 | |
| 2013-09-09 | 2013-09-10 | $10.71 | $11.09 | -3.16% | 2 | |
| 2013-03-27 | 2013-04-02 | $2.54 | $2.96 | 12.65% | 4 | |
| 2013-03-08 | 2013-03-15 | $2.56 | $2.35 | -3.03% | 6 | |
| 2013-01-23 | 2013-02-14 | $2.40 | $2.55 | 7.21% | 17 | |
| 2012-11-20 | 2012-12-14 | $2.20 | $2.25 | 1.56% | 18 | |
| 2012-07-17 | 2012-07-19 | $2.22 | $2.15 | -8.67% | 3 | |
| 2012-03-28 | 2012-04-05 | $2.52 | $2.30 | -6.33% | 7 | |
| 2012-03-14 | 2012-03-16 | $2.35 | $2.35 | -2.58% | 3 | |
| 2012-02-17 | 2012-02-29 | $2.33 | $2.23 | -1.01% | 8 |