LongTermTrend_V1375
ARCHIVEDhybridllmAdded volatility filter (vol_pctile < 0.85) to avoid entries during volatility spikes; tightened 1-year cumulative return tolerance (cumret_252d > -0.15) to reduce drawdown exposure; raised short-term MACD entry floor (macd_hist > -1.5) for cleaner momentum; replaced single MACD exit with a multi-condition exit (exit on macd_hist < 0 OR price crossing below sma_50 OR portfolio drawdown < -15% OR price dropping far below sma_20) to improve risk management; introduced regime gates to avoid DOWNTREND/HIGH_VOLATILITY/EXTREME bubble environments; reduced base_position from 1.0 to 0.8 to lower sizing given prior large drawdowns.
Lineage
added entry filter: sma_20 < close; added entry filter: macd_hist > -2.6055
Strategy Logic (pseudocode)
# LongTermTrend_V1375 [hybrid]
require regime.trend in ['UPTREND', 'SIDEWAYS']
require regime.volatility in ['LOW_VOLATILITY', 'MEDIUM_VOLATILITY']
require regime.bubble in ['NORMAL', 'EXPENSIVE']
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.15 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 > -1.5 and vol_pctile < 0.85):
position = 0.8
if long and (macd_hist < 0.0 or close < sma_50 or drawdown < -0.15 or dist_sma_20 < -0.12):
position = 0.0 # exit to cashBacktest Metrics
| Metric | Train | Validation | Hidden Test | Full |
|---|---|---|---|---|
| CAGR | -0.9% | 28.4% | -4.7% | 3.6% |
| Total Return | -6.7% | 111.8% | -16.4% | 69.2% |
| Sharpe | 0.01 | 1.40 | -0.26 | 0.30 |
| Sortino | 0.01 | 1.26 | -0.18 | 0.23 |
| Calmar | -0.02 | 1.67 | -0.24 | 0.10 |
| Volatility | 14.8% | 19.1% | 14.5% | 15.7% |
| Max DD | -38.2% | -17.0% | -19.4% | -38.2% |
| Win Rate | 38.8% | 57.6% | 42.6% | 44.0% |
| Avg Win | 2.7% | 3.6% | 2.2% | 2.9% |
| Avg Loss | -1.8% | -1.8% | -1.9% | -1.8% |
| Payoff | 1.48 | 2.01 | 1.15 | 1.60 |
| Expectancy | -0.1% | 1.3% | -0.2% | 0.3% |
| Profit Factor | 0.94 | 2.73 | 0.85 | 1.26 |
| Trades | 147 | 66 | 94 | 307 |
| Avg Holding Days | 3.5 | 3.3 | 2.4 | 3.2 |
| Turnover | 29.6 | 35.2 | 40.1 | 33.3 |
| Exposure | 14.9% | 16.1% | 11.4% | 14.3% |
Growth of $100
Walk-Forward Years
| Year | CAGR | Sharpe | Max DD | Trades |
|---|---|---|---|---|
| 2016 | -7.5% | -0.78 | -12.1% | 20 |
| 2017 | 4.7% | 0.36 | -10.3% | 27 |
| 2018 | -7.4% | -0.91 | -11.4% | 5 |
| 2019 | 4.6% | 0.44 | -7.5% | 13 |
| 2020 | 71.8% | 2.64 | -7.1% | 10 |
| 2021 | 24.3% | 1.06 | -16.0% | 37 |
| 2022 | -0.9% | -0.03 | -8.5% | 17 |
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 | 278 | -1.7% | -1.04 | 0% |
| hidden test | EXPENSIVE | 83 | -16.9% | -0.85 | 20% |
| hidden test | EXTREME | 48 | 0.0% | 0.00 | 0% |
| hidden test | HIGH VOLATILITY | 254 | -7.8% | -0.75 | 1% |
| hidden test | LOW VOLATILITY | 441 | 11.7% | 0.77 | 17% |
| hidden test | MEDIUM VOLATILITY | 250 | -26.7% | -1.61 | 12% |
| hidden test | NORMAL | 814 | -2.6% | -0.18 | 11% |
| hidden test | SIDEWAYS | 296 | -18.4% | -1.11 | 16% |
| hidden test | UPTREND | 371 | 6.5% | 0.36 | 16% |
| train | DOWNTREND | 518 | -6.6% | -1.22 | 1% |
| train | EXPENSIVE | 311 | 34.0% | 1.60 | 26% |
| train | EXTREME | 100 | 9.3% | 1.55 | 1% |
| train | HIGH VOLATILITY | 699 | 4.9% | 0.40 | 1% |
| train | LOW VOLATILITY | 745 | 8.2% | 0.53 | 27% |
| train | MEDIUM VOLATILITY | 568 | -15.9% | -0.95 | 16% |
| train | NORMAL | 1,601 | -6.9% | -0.51 | 14% |
| train | SIDEWAYS | 592 | -1.3% | -0.10 | 14% |
| train | UPTREND | 902 | 5.1% | 0.27 | 23% |
| validation | DOWNTREND | 125 | 0.0% | 0.00 | 0% |
| validation | EXPENSIVE | 138 | 93.0% | 3.26 | 31% |
| validation | EXTREME | 144 | 37.7% | 2.61 | 2% |
| validation | HIGH VOLATILITY | 258 | -6.6% | -0.66 | 1% |
| validation | LOW VOLATILITY | 183 | 7.5% | 0.50 | 27% |
| validation | MEDIUM VOLATILITY | 315 | 65.4% | 2.55 | 23% |
| validation | NORMAL | 474 | 4.3% | 0.26 | 16% |
| validation | SIDEWAYS | 206 | 2.8% | 0.27 | 11% |
| validation | UPTREND | 425 | 46.4% | 1.90 | 23% |
Trades (full period)
| Entry | Exit | Entry Px | Exit Px | Return | Days | |
|---|---|---|---|---|---|---|
| 2026-10-07 | 2026-10-08 | $377.81 | $375.00 | -0.76% | 2 | |
| 2026-07-01 | 2026-07-06 | $425.30 | $419.77 | -5.30% | 3 | |
| 2026-05-27 | 2026-06-02 | $440.36 | $423.74 | -3.41% | 5 | |
| 2026-05-22 | 2026-05-26 | $426.01 | $433.59 | 1.40% | 2 | |
| 2026-05-20 | 2026-05-21 | $417.26 | $417.85 | 2.44% | 2 | |
| 2026-05-08 | 2026-05-19 | $428.35 | $404.11 | -0.45% | 8 | |
| 2026-04-20 | 2026-04-21 | $392.50 | $386.42 | -1.78% | 2 | |
| 2025-12-04 | 2025-12-30 | $454.53 | $454.43 | 2.22% | 18 | |
| 2025-11-06 | 2025-11-07 | $445.91 | $429.52 | -2.96% | 2 | |
| 2025-11-03 | 2025-11-05 | $468.37 | $462.07 | -2.29% | 3 | |
| 2025-10-07 | 2025-10-08 | $433.09 | $438.69 | -3.72% | 2 | |
| 2025-09-15 | 2025-10-06 | $410.04 | $453.25 | 6.73% | 16 | |
| 2025-09-11 | 2025-09-12 | $368.81 | $395.94 | 4.67% | 2 | |
| 2025-09-09 | 2025-09-10 | $346.97 | $347.79 | -0.03% | 2 | |
| 2025-09-05 | 2025-09-08 | $350.84 | $346.40 | 2.75% | 2 | |
| 2025-08-29 | 2025-09-02 | $333.87 | $329.36 | -2.96% | 2 | |
| 2025-08-27 | 2025-08-28 | $349.60 | $345.98 | -0.63% | 2 | |
| 2025-08-25 | 2025-08-26 | $346.60 | $351.67 | 1.39% | 2 | |
| 2025-08-19 | 2025-08-20 | $329.31 | $323.90 | -1.56% | 2 | |
| 2025-08-15 | 2025-08-18 | $330.56 | $335.16 | -1.36% | 2 | |
| 2025-08-13 | 2025-08-14 | $339.38 | $335.58 | -0.50% | 2 | |
| 2025-08-11 | 2025-08-12 | $339.03 | $340.84 | 2.11% | 2 | |
| 2025-07-29 | 2025-07-30 | $321.20 | $319.04 | -1.24% | 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.44% | 2 | |
| 2025-06-03 | 2025-06-04 | $344.27 | $332.05 | 0.21% | 2 | |
| 2025-05-30 | 2025-06-02 | $346.46 | $342.69 | -2.83% | 2 | |
| 2025-05-28 | 2025-05-29 | $356.90 | $358.43 | -1.48% | 2 | |
| 2025-05-23 | 2025-05-27 | $339.34 | $362.89 | -0.56% | 2 | |
| 2025-05-21 | 2025-05-22 | $334.62 | $341.04 | -2.30% | 2 | |
| 2025-05-19 | 2025-05-20 | $342.09 | $343.82 | -1.96% | 2 | |
| 2025-05-12 | 2025-05-13 | $318.38 | $334.07 | 5.23% | 2 | |
| 2024-10-07 | 2024-10-08 | $240.83 | $244.50 | -3.12% | 2 | |
| 2024-10-03 | 2024-10-04 | $240.66 | $250.08 | -2.84% | 2 | |
| 2024-10-01 | 2024-10-02 | $258.02 | $249.02 | -1.26% | 2 | |
| 2024-09-27 | 2024-09-30 | $260.46 | $261.63 | 1.80% | 2 | |
| 2024-09-25 | 2024-09-26 | $257.02 | $254.22 | 0.70% | 2 | |
| 2024-09-23 | 2024-09-24 | $250.00 | $254.27 | 3.78% | 2 | |
| 2024-09-18 | 2024-09-19 | $227.20 | $243.92 | -0.40% | 2 | |
| 2024-09-16 | 2024-09-17 | $226.78 | $227.87 | -1.38% | 2 | |
| 2024-09-05 | 2024-09-06 | $230.17 | $210.73 | 3.76% | 2 | |
| 2024-07-11 | 2024-07-12 | $241.03 | $248.23 | -6.91% | 2 | |
| 2024-07-09 | 2024-07-10 | $262.33 | $263.26 | 2.81% | 2 | |
| 2024-07-05 | 2024-07-08 | $251.52 | $252.94 | 1.50% | 2 | |
| 2024-07-02 | 2024-07-03 | $231.26 | $246.39 | 7.99% | 2 | |
| 2024-06-28 | 2024-07-01 | $197.88 | $209.86 | 0.03% | 2 | |
| 2024-06-26 | 2024-06-27 | $196.37 | $197.42 | 3.69% | 2 | |
| 2024-06-24 | 2024-06-25 | $182.58 | $187.35 | -0.35% | 2 | |
| 2024-06-20 | 2024-06-21 | $181.57 | $183.01 | -1.58% | 2 | |
| 2024-06-17 | 2024-06-18 | $187.44 | $184.86 | 4.07% | 2 | |
| 2023-12-28 | 2023-12-29 | $253.18 | $248.48 | -2.69% | 2 | |
| 2023-12-26 | 2023-12-27 | $256.61 | $261.44 | 1.13% | 2 | |
| 2023-12-21 | 2023-12-22 | $254.50 | $252.54 | 2.22% | 2 | |
| 2023-12-19 | 2023-12-20 | $257.22 | $247.14 | 1.47% | 2 | |
| 2023-12-15 | 2023-12-18 | $253.50 | $252.08 | 0.62% | 2 | |
| 2023-12-11 | 2023-12-12 | $239.74 | $237.01 | -1.50% | 2 | |
| 2023-12-07 | 2023-12-08 | $242.64 | $243.84 | 0.93% | 2 | |
| 2023-12-05 | 2023-12-06 | $238.72 | $239.37 | 0.91% | 2 | |
| 2023-12-01 | 2023-12-04 | $238.83 | $235.58 | -0.58% | 2 | |
| 2023-11-29 | 2023-11-30 | $244.14 | $240.08 | -1.00% | 2 | |
| 2023-11-27 | 2023-11-28 | $236.08 | $246.72 | 0.05% | 2 | |
| 2023-11-22 | 2023-11-24 | $234.21 | $235.45 | -2.48% | 2 | |
| 2023-11-20 | 2023-11-21 | $235.60 | $241.20 | 0.28% | 2 | |
| 2023-11-16 | 2023-11-17 | $233.59 | $234.30 | -3.20% | 2 | |
| 2023-10-12 | 2023-10-13 | $258.87 | $251.12 | -1.41% | 2 | |
| 2023-10-10 | 2023-10-11 | $263.62 | $262.99 | 1.06% | 2 | |
| 2023-10-06 | 2023-10-09 | $260.53 | $259.67 | -0.01% | 2 | |
| 2023-09-20 | 2023-09-21 | $262.59 | $255.70 | -1.33% | 2 | |
| 2023-09-18 | 2023-09-19 | $265.28 | $266.50 | -2.81% | 2 | |
| 2023-09-14 | 2023-09-15 | $276.04 | $274.39 | 1.24% | 2 | |
| 2023-09-12 | 2023-09-13 | $267.48 | $271.30 | -1.94% | 2 | |
| 2023-09-06 | 2023-09-07 | $251.92 | $251.49 | -1.58% | 2 | |
| 2023-09-01 | 2023-09-05 | $245.01 | $256.49 | -4.21% | 2 | |
| 2023-08-30 | 2023-08-31 | $256.90 | $258.08 | -0.25% | 2 | |
| 2023-07-19 | 2023-07-20 | $291.26 | $262.90 | -0.73% | 2 | |
| 2023-07-17 | 2023-07-18 | $290.38 | $293.34 | 2.40% | 2 | |
| 2023-07-11 | 2023-07-12 | $269.79 | $271.99 | -0.11% | 2 | |
| 2023-07-07 | 2023-07-10 | $274.43 | $269.61 | -0.77% | 2 | |
| 2023-07-05 | 2023-07-06 | $282.48 | $276.54 | 0.60% | 2 | |
| 2023-06-27 | 2023-06-28 | $250.21 | $256.24 | 2.88% | 2 | |
| 2023-06-23 | 2023-06-26 | $256.60 | $241.05 | -2.58% | 2 | |
| 2023-06-21 | 2023-06-22 | $259.46 | $264.61 | -4.53% | 2 | |
| 2023-06-16 | 2023-06-20 | $260.54 | $274.45 | 1.29% | 2 | |
| 2023-06-14 | 2023-06-15 | $256.79 | $255.90 | -0.75% | 2 | |
| 2023-06-12 | 2023-06-13 | $249.83 | $258.71 | 1.62% | 2 | |
| 2023-06-08 | 2023-06-09 | $234.86 | $244.40 | 3.50% | 2 | |
| 2023-06-06 | 2023-06-07 | $221.31 | $224.57 | 1.20% | 2 | |
| 2023-06-02 | 2023-06-05 | $213.97 | $217.61 | 2.32% | 2 | |
| 2023-05-31 | 2023-06-01 | $203.93 | $207.52 | 0.94% | 2 | |
| 2023-04-05 | 2023-04-06 | $185.52 | $185.06 | -3.09% | 2 | |
| 2023-04-03 | 2023-04-04 | $194.77 | $192.58 | -5.05% | 2 | |
| 2023-03-30 | 2023-03-31 | $195.28 | $207.46 | 0.42% | 2 | |
| 2023-03-28 | 2023-03-29 | $189.19 | $193.88 | -1.25% | 2 | |
| 2023-03-24 | 2023-03-27 | $190.41 | $191.81 | -0.91% | 2 | |
| 2022-09-21 | 2022-09-22 | $300.80 | $288.59 | -2.21% | 2 | |
| 2022-09-19 | 2022-09-20 | $309.07 | $308.73 | 1.35% | 2 | |
| 2022-09-15 | 2022-09-16 | $303.75 | $303.35 | 0.14% | 2 | |
| 2022-09-13 | 2022-09-14 | $292.13 | $302.61 | -3.39% | 2 | |
| 2022-08-22 | 2022-08-23 | $289.91 | $296.45 | -1.98% | 2 | |
| 2022-08-18 | 2022-08-19 | $302.87 | $296.67 | -0.46% | 2 |