LongTermTrend_V0484
ARCHIVEDhybridllm1) Simplified and strengthened entry: require either clear long-term uptrend (close>200SMA & 200SMA slope>0), or short-term uptrend (close>50SMA & 50SMA slope>0), or meaningful 20d momentum (>4%). 2) Added volatility and recent-year performance filters at entry (vol_pctile<0.75, cumret_252d>-15%) to avoid entering into high-vol/deeply losing regimes. 3) Reworked exit to be multi-condition: exit on weak 20d returns, bearish 50SMA break with negative slope, sudden drawdown limit, or volatility spike (vol_pctile>0.9). 4) Added regime gates to restrict trading to UPTREND/SIDEWAYS and non-HIGH volatility, and avoid EXTREME bubble regimes. 5) Introduced volatility-based position sizing rules (low->0.8, medium->0.5, high->0.0) and reduced base position to 0.6 to lower tail risk and drawdown.
Lineage
entry from LongTermTrend_V0140, exit from PriceMomentum_V0160
Strategy Logic (pseudocode)
# LongTermTrend_V0484 [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.0) or (close > sma_50 and sma_50_slope > 0.0) or ret_20d > 0.04) and vol_pctile < 0.75 and cumret_252d > -0.15):
position = 0.6
if long and (ret_20d < 0.02 or (close < sma_50 and sma_50_slope < 0.0) or drawdown < -0.08 or vol_pctile > 0.9):
position = 0.0 # exit to cashBacktest Metrics
| Metric | Train | Validation | Hidden Test | Full |
|---|---|---|---|---|
| CAGR | -4.0% | 20.2% | -11.7% | -1.4% |
| Total Return | -27.6% | 73.8% | -36.9% | -19.2% |
| Sharpe | -0.21 | 1.04 | -0.84 | -0.02 |
| Sortino | -0.18 | 1.18 | -0.70 | -0.02 |
| Calmar | -0.09 | 1.02 | -0.27 | -0.03 |
| Volatility | 14.4% | 19.6% | 13.7% | 15.4% |
| Max DD | -42.3% | -19.9% | -43.8% | -49.0% |
| Win Rate | 42.8% | 49.0% | 42.4% | 44.1% |
| Avg Win | 1.5% | 2.4% | 1.3% | 1.7% |
| Avg Loss | -1.3% | -1.5% | -1.4% | -1.3% |
| Payoff | 1.15 | 1.64 | 0.95 | 1.27 |
| Expectancy | -0.1% | 0.4% | -0.2% | 0.0% |
| Profit Factor | 0.86 | 1.57 | 0.70 | 1.00 |
| Trades | 325 | 155 | 184 | 664 |
| Avg Holding Days | 2.6 | 2.5 | 2.1 | 2.5 |
| Turnover | 48.9 | 62.0 | 59.8 | 54.3 |
| Exposure | 15.7% | 18.4% | 13.5% | 15.7% |
Growth of $100
Walk-Forward Years
| Year | CAGR | Sharpe | Max DD | Trades |
|---|---|---|---|---|
| 2016 | -13.1% | -1.87 | -14.5% | 35 |
| 2017 | -1.6% | -0.04 | -17.5% | 56 |
| 2018 | 0.4% | 0.10 | -5.4% | 16 |
| 2019 | -3.6% | -0.26 | -13.7% | 16 |
| 2020 | 55.7% | 2.70 | -7.0% | 18 |
| 2021 | 14.9% | 0.68 | -18.8% | 89 |
| 2022 | -5.0% | -0.26 | -13.0% | 47 |
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 | -7.7% | -2.00 | 1% |
| hidden test | EXPENSIVE | 83 | -2.6% | -0.13 | 26% |
| hidden test | EXTREME | 48 | 0.0% | 0.00 | 0% |
| hidden test | HIGH VOLATILITY | 254 | -5.1% | -0.45 | 1% |
| hidden test | LOW VOLATILITY | 429 | 2.6% | 0.20 | 19% |
| hidden test | MEDIUM VOLATILITY | 248 | -42.5% | -2.54 | 17% |
| hidden test | NORMAL | 800 | -13.1% | -0.99 | 13% |
| hidden test | SIDEWAYS | 293 | -30.9% | -1.85 | 18% |
| hidden test | UPTREND | 371 | 1.0% | 0.07 | 19% |
| train | DOWNTREND | 518 | -12.0% | -1.30 | 1% |
| train | EXPENSIVE | 311 | 26.7% | 1.45 | 27% |
| train | EXTREME | 100 | 7.0% | 1.55 | 1% |
| train | HIGH VOLATILITY | 699 | -3.1% | -0.23 | 1% |
| train | LOW VOLATILITY | 745 | -0.2% | -0.02 | 26% |
| train | MEDIUM VOLATILITY | 568 | -6.6% | -0.40 | 20% |
| train | NORMAL | 1,601 | -9.4% | -0.68 | 14% |
| train | SIDEWAYS | 592 | -5.1% | -0.40 | 13% |
| train | UPTREND | 902 | 3.5% | 0.20 | 26% |
| validation | DOWNTREND | 125 | -3.4% | -1.73 | 0% |
| validation | EXPENSIVE | 138 | 70.7% | 2.94 | 34% |
| validation | EXTREME | 144 | 31.9% | 2.85 | 2% |
| validation | HIGH VOLATILITY | 258 | 6.3% | 0.45 | 1% |
| validation | LOW VOLATILITY | 183 | 2.3% | 0.16 | 29% |
| validation | MEDIUM VOLATILITY | 315 | 42.3% | 1.67 | 27% |
| validation | NORMAL | 474 | 2.1% | 0.11 | 19% |
| validation | SIDEWAYS | 206 | -16.8% | -0.93 | 20% |
| validation | UPTREND | 425 | 45.3% | 1.99 | 23% |
Trades (full period)
| Entry | Exit | Entry Px | Exit Px | Return | Days | |
|---|---|---|---|---|---|---|
| 2026-07-02 | 2026-07-06 | $393.45 | $419.77 | -4.61% | 2 | |
| 2026-06-30 | 2026-07-01 | $420.60 | $425.30 | 1.16% | 2 | |
| 2026-06-23 | 2026-06-24 | $381.61 | $375.53 | -3.59% | 2 | |
| 2026-06-16 | 2026-06-17 | $404.66 | $396.38 | -1.07% | 2 | |
| 2026-06-12 | 2026-06-15 | $406.43 | $411.15 | 0.97% | 2 | |
| 2026-06-09 | 2026-06-10 | $396.68 | $381.59 | -1.92% | 2 | |
| 2026-06-04 | 2026-06-05 | $418.45 | $391.00 | -0.86% | 2 | |
| 2026-06-02 | 2026-06-03 | $423.74 | $423.70 | 1.01% | 2 | |
| 2026-05-29 | 2026-06-01 | $435.79 | $415.88 | -0.98% | 2 | |
| 2026-05-27 | 2026-05-28 | $440.36 | $442.10 | 0.82% | 2 | |
| 2026-05-22 | 2026-05-26 | $426.01 | $433.59 | 1.05% | 2 | |
| 2026-05-20 | 2026-05-21 | $417.26 | $417.85 | 1.83% | 2 | |
| 2026-05-18 | 2026-05-19 | $409.99 | $404.11 | -1.86% | 2 | |
| 2026-05-14 | 2026-05-15 | $443.30 | $422.24 | -0.39% | 2 | |
| 2026-05-12 | 2026-05-13 | $433.45 | $445.27 | -1.68% | 2 | |
| 2026-05-08 | 2026-05-11 | $428.35 | $445.00 | 2.29% | 2 | |
| 2026-04-20 | 2026-04-21 | $392.50 | $386.42 | -1.34% | 2 | |
| 2026-03-17 | 2026-03-18 | $399.27 | $392.78 | 0.44% | 2 | |
| 2026-03-12 | 2026-03-13 | $395.01 | $391.20 | -2.00% | 2 | |
| 2026-03-10 | 2026-03-11 | $399.24 | $407.82 | -0.04% | 2 | |
| 2026-03-06 | 2026-03-09 | $396.73 | $398.68 | -1.42% | 2 | |
| 2026-03-04 | 2026-03-05 | $405.94 | $405.55 | 1.94% | 2 | |
| 2026-03-02 | 2026-03-03 | $403.32 | $392.43 | 0.00% | 2 | |
| 2026-02-26 | 2026-02-27 | $408.58 | $402.51 | -1.39% | 2 | |
| 2026-02-24 | 2026-02-25 | $409.38 | $417.40 | 1.31% | 2 | |
| 2026-02-20 | 2026-02-23 | $411.82 | $399.83 | -0.10% | 2 | |
| 2026-02-18 | 2026-02-19 | $411.32 | $411.71 | -0.02% | 2 | |
| 2026-02-13 | 2026-02-17 | $417.44 | $410.63 | -0.07% | 2 | |
| 2026-02-11 | 2026-02-12 | $428.27 | $417.07 | 0.31% | 2 | |
| 2026-02-09 | 2026-02-10 | $417.32 | $425.21 | 0.79% | 2 | |
| 2026-02-05 | 2026-02-06 | $397.21 | $411.11 | -1.42% | 2 | |
| 2026-02-03 | 2026-02-04 | $421.96 | $406.01 | -0.10% | 2 | |
| 2026-01-30 | 2026-02-02 | $430.41 | $421.81 | 1.87% | 2 | |
| 2026-01-28 | 2026-01-29 | $431.46 | $416.56 | -0.04% | 2 | |
| 2026-01-26 | 2026-01-27 | $435.20 | $430.90 | -1.97% | 2 | |
| 2026-01-22 | 2026-01-23 | $449.36 | $449.06 | 2.37% | 2 | |
| 2026-01-20 | 2026-01-21 | $419.25 | $431.44 | -2.62% | 2 | |
| 2026-01-15 | 2026-01-16 | $438.57 | $437.50 | -0.21% | 2 | |
| 2026-01-13 | 2026-01-14 | $447.20 | $439.20 | -0.35% | 2 | |
| 2026-01-09 | 2026-01-12 | $445.01 | $448.96 | 1.15% | 2 | |
| 2026-01-07 | 2026-01-08 | $431.41 | $435.80 | -0.33% | 2 | |
| 2026-01-05 | 2026-01-06 | $451.67 | $432.96 | 1.74% | 2 | |
| 2025-12-10 | 2026-01-02 | $451.45 | $438.07 | 0.60% | 16 | |
| 2025-12-08 | 2025-12-09 | $439.58 | $445.17 | -2.15% | 2 | |
| 2025-12-04 | 2025-12-05 | $454.53 | $455.00 | 0.93% | 2 | |
| 2025-12-02 | 2025-12-03 | $429.24 | $446.74 | -0.25% | 2 | |
| 2025-11-28 | 2025-12-01 | $430.17 | $430.14 | 0.38% | 2 | |
| 2025-11-25 | 2025-11-26 | $419.40 | $426.58 | 0.11% | 2 | |
| 2025-11-21 | 2025-11-24 | $391.09 | $417.78 | -0.75% | 2 | |
| 2025-11-19 | 2025-11-20 | $403.99 | $395.23 | 0.29% | 2 | |
| 2025-11-17 | 2025-11-18 | $408.92 | $401.25 | 0.56% | 2 | |
| 2025-11-13 | 2025-11-14 | $401.99 | $404.35 | -4.10% | 2 | |
| 2025-11-11 | 2025-11-12 | $439.62 | $430.60 | -0.88% | 2 | |
| 2025-10-31 | 2025-11-10 | $456.56 | $445.23 | -1.46% | 7 | |
| 2025-10-28 | 2025-10-30 | $460.55 | $440.10 | 1.08% | 3 | |
| 2025-10-24 | 2025-10-27 | $433.72 | $452.42 | -2.16% | 2 | |
| 2025-10-21 | 2025-10-23 | $442.60 | $448.98 | -1.26% | 3 | |
| 2025-10-17 | 2025-10-20 | $439.31 | $447.43 | 1.36% | 2 | |
| 2025-10-15 | 2025-10-16 | $435.15 | $428.75 | 0.71% | 2 | |
| 2025-10-13 | 2025-10-14 | $435.90 | $429.24 | 3.13% | 2 | |
| 2025-10-09 | 2025-10-10 | $435.54 | $413.49 | -0.55% | 2 | |
| 2025-10-06 | 2025-10-08 | $453.25 | $438.69 | 0.39% | 3 | |
| 2025-09-29 | 2025-10-03 | $443.21 | $429.83 | -0.67% | 5 | |
| 2025-09-24 | 2025-09-26 | $442.79 | $440.40 | -0.42% | 3 | |
| 2025-09-22 | 2025-09-23 | $434.21 | $425.85 | 1.03% | 2 | |
| 2025-09-18 | 2025-09-19 | $416.85 | $426.07 | -1.39% | 2 | |
| 2025-09-16 | 2025-09-17 | $421.62 | $425.86 | 1.57% | 2 | |
| 2025-09-12 | 2025-09-15 | $395.94 | $410.04 | 4.29% | 2 | |
| 2025-09-10 | 2025-09-11 | $347.79 | $368.81 | 0.02% | 2 | |
| 2025-09-08 | 2025-09-09 | $346.40 | $346.97 | -0.88% | 2 | |
| 2025-09-04 | 2025-09-05 | $338.53 | $350.84 | 0.68% | 2 | |
| 2025-09-02 | 2025-09-03 | $329.36 | $334.09 | -0.93% | 2 | |
| 2025-08-28 | 2025-08-29 | $345.98 | $333.87 | -0.74% | 2 | |
| 2025-08-26 | 2025-08-27 | $351.67 | $349.60 | 0.76% | 2 | |
| 2025-08-22 | 2025-08-25 | $340.01 | $346.60 | 3.61% | 2 | |
| 2025-08-19 | 2025-08-20 | $329.31 | $323.90 | -1.17% | 2 | |
| 2025-08-15 | 2025-08-18 | $330.56 | $335.16 | -1.02% | 2 | |
| 2025-08-13 | 2025-08-14 | $339.38 | $335.58 | -0.38% | 2 | |
| 2025-08-11 | 2025-08-12 | $339.03 | $340.84 | 1.59% | 2 | |
| 2025-08-05 | 2025-08-06 | $308.72 | $319.91 | -0.22% | 2 | |
| 2025-07-31 | 2025-08-01 | $308.27 | $302.63 | -2.14% | 2 | |
| 2025-07-29 | 2025-07-30 | $321.20 | $319.04 | -0.93% | 2 | |
| 2025-07-23 | 2025-07-24 | $332.56 | $305.30 | -0.04% | 2 | |
| 2025-07-21 | 2025-07-22 | $328.49 | $332.11 | -0.33% | 2 | |
| 2025-07-17 | 2025-07-18 | $319.41 | $329.65 | -0.54% | 2 | |
| 2025-07-15 | 2025-07-16 | $310.78 | $321.67 | -1.28% | 2 | |
| 2025-06-05 | 2025-06-06 | $284.70 | $295.14 | -8.67% | 2 | |
| 2025-06-03 | 2025-06-04 | $344.27 | $332.05 | 0.16% | 2 | |
| 2025-05-30 | 2025-06-02 | $346.46 | $342.69 | -2.12% | 2 | |
| 2025-05-28 | 2025-05-29 | $356.90 | $358.43 | -1.11% | 2 | |
| 2025-05-23 | 2025-05-27 | $339.34 | $362.89 | -0.42% | 2 | |
| 2025-05-21 | 2025-05-22 | $334.62 | $341.04 | -1.72% | 2 | |
| 2025-05-19 | 2025-05-20 | $342.09 | $343.82 | -1.47% | 2 | |
| 2025-05-12 | 2025-05-13 | $318.38 | $334.07 | 3.93% | 2 | |
| 2025-03-04 | 2025-03-05 | $272.04 | $279.10 | -2.78% | 2 | |
| 2025-02-27 | 2025-02-28 | $281.95 | $292.98 | -1.94% | 2 | |
| 2025-02-25 | 2025-02-26 | $302.80 | $290.80 | -5.15% | 2 | |
| 2025-02-21 | 2025-02-24 | $337.80 | $330.53 | -2.93% | 2 | |
| 2025-02-19 | 2025-02-20 | $360.56 | $354.40 | 0.97% | 2 | |
| 2025-02-14 | 2025-02-18 | $355.84 | $354.11 | -0.14% | 2 |