LongTermTrend_V0662
ARCHIVEDhybridllm['Added conservative regime gating: allow only UPTREND and exclude extreme bubble (bubble = NORMAL) and high volatility (only LOW/MEDIUM). This reduces exposure in unfavorable regimes.', 'Tightened entry macd_hist filter from > -2.6055 to > -0.5 to avoid very weak MACD environments.', 'Replaced single-signal exit with a clearer multi-condition exit: exit when MACD turns negative OR price drops below sma_50 OR drawdown exceeds 15% — to cut large losses and improve walk-forward robustness.', 'Reduced base position from 1.0 to 0.7 to lower leverage/exposure and dampen max drawdowns.']
Lineage
added entry filter: sma_20 < close; added entry filter: macd_hist > -2.6055
Strategy Logic (pseudocode)
# LongTermTrend_V0662 [hybrid]
require regime.trend in ['UPTREND']
require regime.volatility in ['LOW_VOLATILITY', 'MEDIUM_VOLATILITY']
require regime.bubble in ['NORMAL']
if flat and (((((close > sma_200 and sma_200_slope > -0.0024) or ret_20d > 0.085) and ret_20d > 0.05 and cumret_252d > -0.1997 and dist_sma_50 > -0.0774) or ((macd_hist > 0.0 and close > sma_50) or ((breakout_50 == 1 and rel_volume > 1.5045) or ((macd_hist > 0.0 and close > sma_50) and sma_50 > sma_200)))) and sma_20 < close and macd_hist > -0.5):
position = 0.7
if long and (macd_hist < 0.0 or close < sma_50 or drawdown < -0.15):
position = 0.0 # exit to cashBacktest Metrics
| Metric | Train | Validation | Hidden Test | Full |
|---|---|---|---|---|
| CAGR | -2.5% | -0.8% | -1.0% | -1.8% |
| Total Return | -18.5% | -2.4% | -3.8% | -23.4% |
| Sharpe | -0.25 | -0.02 | -0.06 | -0.15 |
| Sortino | -0.12 | -0.01 | -0.02 | -0.07 |
| Calmar | -0.10 | -0.03 | -0.07 | -0.06 |
| Volatility | 8.7% | 10.6% | 9.7% | 9.4% |
| Max DD | -26.5% | -26.1% | -15.0% | -31.9% |
| Win Rate | 38.6% | 43.5% | 42.9% | 40.6% |
| Avg Win | 1.9% | 2.7% | 2.6% | 2.3% |
| Avg Loss | -1.6% | -2.1% | -2.1% | -1.8% |
| Payoff | 1.19 | 1.30 | 1.26 | 1.25 |
| Expectancy | -0.3% | -0.0% | -0.1% | -0.2% |
| Profit Factor | 0.75 | 1.00 | 0.94 | 0.85 |
| Trades | 70 | 23 | 35 | 128 |
| Avg Holding Days | 3.4 | 3.7 | 2.5 | 3.2 |
| Turnover | 12.3 | 10.7 | 13.2 | 12.2 |
| Exposure | 5.8% | 5.6% | 3.9% | 5.3% |
Growth of $100
Walk-Forward Years
| Year | CAGR | Sharpe | Max DD | Trades |
|---|---|---|---|---|
| 2016 | -2.8% | -0.45 | -7.5% | 12 |
| 2017 | 4.5% | 0.80 | -3.8% | 11 |
| 2018 | -6.4% | -1.34 | -6.4% | 4 |
| 2019 | -1.3% | -0.18 | -5.5% | 3 |
| 2020 | 0.0% | 0.00 | 0.0% | 0 |
| 2021 | 13.5% | 0.86 | -14.1% | 13 |
| 2022 | -14.0% | -1.78 | -16.2% | 9 |
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 | 270 | 0.0% | 0.00 | 0% |
| hidden test | EXPENSIVE | 83 | 29.5% | 2.44 | 2% |
| hidden test | EXTREME | 48 | 0.0% | 0.00 | 0% |
| hidden test | HIGH VOLATILITY | 254 | -17.3% | -1.76 | 1% |
| hidden test | LOW VOLATILITY | 430 | 0.3% | 0.03 | 5% |
| hidden test | MEDIUM VOLATILITY | 250 | 15.0% | 1.39 | 5% |
| hidden test | NORMAL | 803 | -3.7% | -0.38 | 4% |
| hidden test | SIDEWAYS | 293 | -8.8% | -1.47 | 1% |
| hidden test | UPTREND | 371 | 5.5% | 0.38 | 9% |
| train | DOWNTREND | 518 | 0.0% | 0.00 | 0% |
| train | EXPENSIVE | 311 | 8.2% | 1.69 | 1% |
| train | EXTREME | 100 | 0.0% | 0.00 | 0% |
| train | HIGH VOLATILITY | 699 | 0.6% | 0.08 | 0% |
| train | LOW VOLATILITY | 745 | -0.6% | -0.06 | 12% |
| train | MEDIUM VOLATILITY | 568 | -7.7% | -0.99 | 4% |
| train | NORMAL | 1,601 | -4.3% | -0.46 | 7% |
| train | SIDEWAYS | 592 | -2.0% | -0.84 | 0% |
| train | UPTREND | 902 | -3.5% | -0.28 | 13% |
| validation | DOWNTREND | 125 | 0.0% | 0.00 | 0% |
| validation | EXPENSIVE | 138 | 0.0% | 0.00 | 0% |
| validation | EXTREME | 144 | 0.0% | 0.00 | 0% |
| validation | HIGH VOLATILITY | 258 | -5.8% | -0.66 | 1% |
| validation | LOW VOLATILITY | 183 | 3.7% | 0.42 | 15% |
| validation | MEDIUM VOLATILITY | 315 | 2.0% | 0.16 | 5% |
| validation | NORMAL | 474 | -0.4% | -0.03 | 9% |
| validation | SIDEWAYS | 206 | -9.6% | -1.57 | 1% |
| validation | UPTREND | 425 | 4.2% | 0.31 | 10% |
Trades (full period)
| Entry | Exit | Entry Px | Exit Px | Return | Days | |
|---|---|---|---|---|---|---|
| 2026-07-01 | 2026-07-06 | $425.30 | $419.77 | -4.63% | 3 | |
| 2026-05-29 | 2026-06-01 | $435.79 | $415.88 | -1.14% | 2 | |
| 2025-12-04 | 2025-12-30 | $454.53 | $454.43 | 1.98% | 18 | |
| 2025-09-12 | 2025-09-15 | $395.94 | $410.04 | 5.01% | 2 | |
| 2025-07-29 | 2025-07-30 | $321.20 | $319.04 | -1.08% | 2 | |
| 2025-07-23 | 2025-07-24 | $332.56 | $305.30 | -0.05% | 2 | |
| 2025-07-21 | 2025-07-22 | $328.49 | $332.11 | -0.39% | 2 | |
| 2025-06-02 | 2025-06-03 | $342.69 | $344.27 | -0.90% | 2 | |
| 2025-05-27 | 2025-05-28 | $362.89 | $356.90 | 4.71% | 2 | |
| 2025-05-22 | 2025-05-23 | $341.04 | $339.34 | 1.20% | 2 | |
| 2024-10-07 | 2024-10-08 | $240.83 | $244.50 | -2.73% | 2 | |
| 2024-10-03 | 2024-10-04 | $240.66 | $250.08 | -2.49% | 2 | |
| 2024-09-25 | 2024-09-26 | $257.02 | $254.22 | 0.62% | 2 | |
| 2024-09-23 | 2024-09-24 | $250.00 | $254.27 | 3.31% | 2 | |
| 2024-09-18 | 2024-09-19 | $227.20 | $243.92 | -0.35% | 2 | |
| 2024-09-16 | 2024-09-17 | $226.78 | $227.87 | -1.21% | 2 | |
| 2024-09-06 | 2024-09-09 | $210.73 | $216.27 | -6.05% | 2 | |
| 2024-09-04 | 2024-09-05 | $219.41 | $230.17 | 2.79% | 2 | |
| 2024-07-11 | 2024-07-12 | $241.03 | $248.23 | -6.05% | 2 | |
| 2024-07-09 | 2024-07-10 | $262.33 | $263.26 | 2.46% | 2 | |
| 2024-07-05 | 2024-07-08 | $251.52 | $252.94 | 1.32% | 2 | |
| 2024-07-02 | 2024-07-03 | $231.26 | $246.39 | 6.99% | 2 | |
| 2023-09-01 | 2023-09-05 | $245.01 | $256.49 | -3.68% | 2 | |
| 2023-08-30 | 2023-08-31 | $256.90 | $258.08 | -0.22% | 2 | |
| 2023-07-19 | 2023-07-20 | $291.26 | $262.90 | -0.64% | 2 | |
| 2023-07-10 | 2023-07-11 | $269.61 | $269.79 | -1.37% | 2 | |
| 2023-07-06 | 2023-07-07 | $276.54 | $274.43 | -1.61% | 2 | |
| 2023-06-23 | 2023-06-26 | $256.60 | $241.05 | -2.26% | 2 | |
| 2023-06-21 | 2023-06-22 | $259.46 | $264.61 | -3.96% | 2 | |
| 2023-06-16 | 2023-06-20 | $260.54 | $274.45 | 1.13% | 2 | |
| 2023-06-14 | 2023-06-15 | $256.79 | $255.90 | -0.66% | 2 | |
| 2023-06-12 | 2023-06-13 | $249.83 | $258.71 | 1.41% | 2 | |
| 2023-06-08 | 2023-06-09 | $234.86 | $244.40 | 3.07% | 2 | |
| 2023-06-06 | 2023-06-07 | $221.31 | $224.57 | 1.05% | 2 | |
| 2023-06-02 | 2023-06-05 | $213.97 | $217.61 | 2.03% | 2 | |
| 2022-09-21 | 2022-09-22 | $300.80 | $288.59 | -1.94% | 2 | |
| 2022-09-19 | 2022-09-20 | $309.07 | $308.73 | 1.18% | 2 | |
| 2022-09-15 | 2022-09-16 | $303.75 | $303.35 | 0.12% | 2 | |
| 2022-09-13 | 2022-09-14 | $292.13 | $302.61 | -2.96% | 2 | |
| 2022-08-18 | 2022-08-19 | $302.87 | $296.67 | -0.40% | 2 | |
| 2022-08-16 | 2022-08-17 | $306.56 | $304.00 | -0.76% | 2 | |
| 2022-08-05 | 2022-08-08 | $288.17 | $290.42 | -4.78% | 2 | |
| 2022-04-05 | 2022-04-11 | $363.75 | $325.31 | -7.53% | 5 | |
| 2022-01-12 | 2022-01-13 | $368.74 | $343.85 | 2.61% | 2 | |
| 2021-12-28 | 2022-01-03 | $362.82 | $399.93 | -2.52% | 5 | |
| 2021-10-12 | 2021-11-10 | $268.57 | $355.98 | 20.11% | 22 | |
| 2021-10-08 | 2021-10-11 | $261.83 | $263.98 | -0.86% | 2 | |
| 2021-09-27 | 2021-10-07 | $263.79 | $264.54 | 0.62% | 9 | |
| 2021-09-16 | 2021-09-21 | $252.33 | $246.46 | -2.51% | 4 | |
| 2021-09-14 | 2021-09-15 | $248.16 | $251.94 | 0.00% | 2 | |
| 2021-09-07 | 2021-09-13 | $250.97 | $247.67 | 0.13% | 5 | |
| 2021-09-02 | 2021-09-03 | $244.13 | $244.52 | -0.30% | 2 | |
| 2021-08-31 | 2021-09-01 | $245.24 | $244.70 | 0.32% | 2 | |
| 2021-08-26 | 2021-08-27 | $233.72 | $237.31 | -1.13% | 2 | |
| 2021-08-13 | 2021-08-16 | $239.06 | $228.72 | -0.63% | 2 | |
| 2021-08-11 | 2021-08-12 | $235.94 | $240.75 | -0.35% | 2 | |
| 2021-08-09 | 2021-08-10 | $237.92 | $236.66 | 1.33% | 2 | |
| 2021-08-05 | 2021-08-06 | $238.21 | $233.03 | 0.23% | 2 | |
| 2019-12-16 | 2019-12-17 | $25.43 | $25.27 | 4.37% | 2 | |
| 2019-11-22 | 2019-11-25 | $22.20 | $22.42 | -4.44% | 2 | |
| 2019-10-21 | 2019-10-22 | $16.90 | $17.04 | -1.08% | 2 | |
| 2018-12-11 | 2018-12-18 | $24.45 | $22.47 | -3.32% | 6 | |
| 2018-12-06 | 2018-12-07 | $24.20 | $23.86 | 0.51% | 2 | |
| 2018-11-29 | 2018-11-30 | $22.74 | $23.37 | -1.49% | 2 | |
| 2018-02-01 | 2018-02-05 | $23.28 | $22.21 | -2.23% | 3 | |
| 2017-10-18 | 2017-10-20 | $23.98 | $23.01 | -0.91% | 3 | |
| 2017-10-13 | 2017-10-17 | $23.70 | $23.72 | -1.14% | 3 | |
| 2017-03-24 | 2017-03-28 | $17.54 | $18.50 | 4.08% | 3 | |
| 2017-03-20 | 2017-03-22 | $17.46 | $17.00 | -3.03% | 3 | |
| 2017-01-31 | 2017-02-02 | $16.80 | $16.77 | -0.53% | 3 | |
| 2017-01-20 | 2017-01-25 | $16.32 | $16.96 | 2.96% | 4 | |
| 2017-01-18 | 2017-01-19 | $15.89 | $16.25 | 0.69% | 2 | |
| 2017-01-13 | 2017-01-17 | $15.85 | $15.71 | 2.35% | 2 | |
| 2017-01-11 | 2017-01-12 | $15.32 | $15.31 | -0.18% | 2 | |
| 2017-01-09 | 2017-01-10 | $15.42 | $15.32 | 0.55% | 2 | |
| 2017-01-05 | 2017-01-06 | $15.12 | $15.27 | -0.21% | 2 | |
| 2016-08-05 | 2016-08-08 | $15.34 | $15.08 | -0.32% | 2 | |
| 2016-08-03 | 2016-08-04 | $15.05 | $15.37 | -0.57% | 2 | |
| 2016-08-01 | 2016-08-02 | $15.33 | $15.15 | -1.56% | 2 | |
| 2016-07-28 | 2016-07-29 | $15.37 | $15.65 | 0.51% | 2 | |
| 2016-07-26 | 2016-07-27 | $15.30 | $15.23 | -0.29% | 2 | |
| 2016-06-08 | 2016-06-09 | $15.70 | $15.29 | 0.82% | 2 | |
| 2016-04-27 | 2016-04-28 | $16.76 | $16.51 | -0.77% | 2 | |
| 2016-04-25 | 2016-04-26 | $16.79 | $16.92 | -0.67% | 2 | |
| 2016-04-21 | 2016-04-22 | $16.55 | $16.92 | -0.61% | 2 | |
| 2016-04-19 | 2016-04-20 | $16.49 | $16.66 | -1.93% | 2 | |
| 2016-04-15 | 2016-04-18 | $16.97 | $16.93 | 0.60% | 2 | |
| 2016-04-05 | 2016-04-14 | $17.03 | $16.79 | 2.04% | 8 | |
| 2015-08-06 | 2015-08-07 | $16.41 | $16.17 | -6.35% | 2 | |
| 2015-07-21 | 2015-07-22 | $17.78 | $17.86 | -3.98% | 2 | |
| 2015-07-15 | 2015-07-16 | $17.54 | $17.78 | -0.80% | 2 | |
| 2015-06-22 | 2015-07-09 | $17.32 | $17.19 | -2.08% | 13 | |
| 2015-06-18 | 2015-06-19 | $17.46 | $17.50 | 0.26% | 2 | |
| 2015-06-09 | 2015-06-10 | $17.07 | $16.71 | -0.22% | 2 | |
| 2015-06-05 | 2015-06-08 | $16.61 | $17.09 | 0.78% | 2 | |
| 2015-06-03 | 2015-06-04 | $16.60 | $16.39 | 0.04% | 2 | |
| 2015-06-01 | 2015-06-02 | $16.63 | $16.56 | -0.52% | 2 | |
| 2015-05-28 | 2015-05-29 | $16.76 | $16.72 | 1.00% | 2 | |
| 2015-05-26 | 2015-05-27 | $16.50 | $16.50 | -0.22% | 2 | |
| 2015-05-13 | 2015-05-22 | $16.21 | $16.52 | 0.12% | 8 |