LongTermTrend_V0988
ARCHIVEDhybridllmSimplified and regularized entry to reduce overfitting: keep long-term trend or recent 20d strength + short-term momentum (MACD or price>50SMA), require mild RSI floor and not-too-far below 50SMA. Added robust exits: 20d downside stop (-2%), plus breaks below 20SMA or 50SMA and extreme RSI to cut losses/rotations earlier. Added regime gates to block DOWNTREND, HIGH_VOLATILITY and EXPENSIVE/EXTREME bubble states. Added position scaling rules: reduce size in high vol (vol_pctile) and keep full size on strong volume spikes. Reduced base position from 1.0 to 0.8 to lower drawdown risk.
Lineage
entry from LongTermTrend_V0663, exit from PriceMomentum_V0640
Strategy Logic (pseudocode)
# LongTermTrend_V0988 [hybrid]
require regime.trend in ['UPTREND', 'SIDEWAYS']
require regime.volatility in ['LOW_VOLATILITY', 'MEDIUM_VOLATILITY']
require regime.bubble in ['NORMAL']
if flat and (((close > sma_200 and sma_200_slope > -0.001) or ret_20d > 0.04) and (macd_hist > 0.0 or close > sma_50) and rsi_14 > 35.0 and dist_sma_50 > -0.15):
position = 0.8
if long and (ret_20d < -0.02 or close < sma_20 or close < sma_50 or rsi_14 > 78.0):
position = 0.0 # exit to cashBacktest Metrics
| Metric | Train | Validation | Hidden Test | Full |
|---|---|---|---|---|
| CAGR | -5.6% | -1.8% | -11.0% | -6.2% |
| Total Return | -36.7% | -5.3% | -35.1% | -61.1% |
| Sharpe | -0.26 | -0.00 | -0.51 | -0.28 |
| Sortino | -0.19 | -0.00 | -0.39 | -0.20 |
| Calmar | -0.11 | -0.05 | -0.31 | -0.10 |
| Volatility | 16.5% | 18.7% | 19.1% | 17.6% |
| Max DD | -49.9% | -33.7% | -35.6% | -64.9% |
| Win Rate | 33.8% | 44.1% | 32.5% | 35.7% |
| Avg Win | 3.3% | 3.1% | 3.6% | 3.3% |
| Avg Loss | -2.1% | -2.5% | -2.4% | -2.3% |
| Payoff | 1.57 | 1.26 | 1.49 | 1.47 |
| Expectancy | -0.3% | -0.0% | -0.5% | -0.3% |
| Profit Factor | 0.81 | 0.99 | 0.72 | 0.82 |
| Trades | 130 | 59 | 80 | 269 |
| Avg Holding Days | 4.4 | 3.8 | 3.7 | 4.1 |
| Turnover | 26.1 | 31.5 | 34.4 | 29.3 |
| Exposure | 17.6% | 17.5% | 18.6% | 17.8% |
Growth of $100
Walk-Forward Years
| Year | CAGR | Sharpe | Max DD | Trades |
|---|---|---|---|---|
| 2016 | -6.7% | -0.55 | -15.3% | 19 |
| 2017 | 14.5% | 1.71 | -4.3% | 13 |
| 2018 | -10.1% | -0.80 | -15.6% | 6 |
| 2019 | -10.8% | -0.42 | -22.6% | 11 |
| 2020 | 0.0% | 0.00 | 0.0% | 0 |
| 2021 | 10.7% | 0.58 | -16.8% | 40 |
| 2022 | -22.8% | -1.09 | -33.7% | 18 |
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 | 275 | -3.7% | -1.67 | 1% |
| hidden test | EXPENSIVE | 83 | 34.2% | 2.44 | 2% |
| hidden test | EXTREME | 48 | 0.0% | 0.00 | 0% |
| hidden test | HIGH VOLATILITY | 254 | -8.7% | -0.63 | 2% |
| hidden test | LOW VOLATILITY | 434 | 1.5% | 0.08 | 28% |
| hidden test | MEDIUM VOLATILITY | 251 | -30.3% | -1.26 | 19% |
| hidden test | NORMAL | 808 | -14.9% | -0.74 | 21% |
| hidden test | SIDEWAYS | 293 | -42.9% | -2.02 | 31% |
| hidden test | UPTREND | 371 | 11.9% | 0.50 | 22% |
| train | DOWNTREND | 518 | -6.5% | -1.22 | 1% |
| train | EXPENSIVE | 311 | 9.6% | 1.73 | 2% |
| train | EXTREME | 100 | 0.0% | 0.00 | 0% |
| train | HIGH VOLATILITY | 699 | 1.0% | 0.06 | 1% |
| train | LOW VOLATILITY | 745 | 9.3% | 0.58 | 32% |
| train | MEDIUM VOLATILITY | 568 | -28.9% | -1.53 | 19% |
| train | NORMAL | 1,601 | -7.4% | -0.40 | 22% |
| train | SIDEWAYS | 592 | -19.8% | -1.06 | 21% |
| train | UPTREND | 902 | 7.0% | 0.37 | 25% |
| validation | DOWNTREND | 125 | -0.8% | -2.67 | 1% |
| validation | EXPENSIVE | 138 | 0.0% | 0.00 | 0% |
| validation | EXTREME | 144 | 0.0% | 0.00 | 0% |
| validation | HIGH VOLATILITY | 258 | -5.8% | -0.37 | 1% |
| validation | LOW VOLATILITY | 183 | 16.5% | 0.89 | 40% |
| validation | MEDIUM VOLATILITY | 315 | -5.0% | -0.24 | 18% |
| validation | NORMAL | 474 | -0.1% | -0.00 | 28% |
| validation | SIDEWAYS | 206 | -17.1% | -0.66 | 30% |
| validation | UPTREND | 425 | 8.5% | 0.49 | 16% |
Trades (full period)
| Entry | Exit | Entry Px | Exit Px | Return | Days | |
|---|---|---|---|---|---|---|
| 2026-07-01 | 2026-07-06 | $425.30 | $419.77 | -5.30% | 3 | |
| 2026-06-05 | 2026-06-08 | $391.00 | $408.95 | -5.40% | 2 | |
| 2026-06-03 | 2026-06-04 | $423.70 | $418.45 | -0.17% | 2 | |
| 2026-05-08 | 2026-06-02 | $428.35 | $423.74 | 0.73% | 17 | |
| 2026-04-20 | 2026-04-21 | $392.50 | $386.42 | -1.78% | 2 | |
| 2026-03-17 | 2026-03-18 | $399.27 | $392.78 | 0.59% | 2 | |
| 2026-03-13 | 2026-03-16 | $391.20 | $395.56 | -0.93% | 2 | |
| 2026-03-11 | 2026-03-12 | $407.82 | $395.01 | 1.56% | 2 | |
| 2026-03-06 | 2026-03-09 | $396.73 | $398.68 | -1.90% | 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.85% | 2 | |
| 2026-02-23 | 2026-02-24 | $399.83 | $409.38 | -2.49% | 2 | |
| 2026-02-19 | 2026-02-20 | $411.71 | $411.82 | -0.08% | 2 | |
| 2026-02-17 | 2026-02-18 | $410.63 | $411.32 | -1.46% | 2 | |
| 2026-02-12 | 2026-02-13 | $417.07 | $417.44 | -2.25% | 2 | |
| 2026-01-23 | 2026-01-26 | $449.06 | $435.20 | -0.21% | 2 | |
| 2026-01-14 | 2026-01-15 | $439.20 | $438.57 | -1.59% | 2 | |
| 2026-01-12 | 2026-01-13 | $448.96 | $447.20 | 0.55% | 2 | |
| 2026-01-06 | 2026-01-07 | $432.96 | $431.41 | -3.47% | 2 | |
| 2025-12-31 | 2026-01-02 | $449.72 | $438.07 | -0.99% | 2 | |
| 2025-12-03 | 2025-12-30 | $446.74 | $454.43 | 5.56% | 19 | |
| 2025-12-01 | 2025-12-02 | $430.14 | $429.24 | -0.17% | 2 | |
| 2025-11-13 | 2025-11-14 | $401.99 | $404.35 | -5.47% | 2 | |
| 2025-09-04 | 2025-09-15 | $338.53 | $410.04 | 14.46% | 8 | |
| 2025-08-25 | 2025-09-03 | $346.60 | $334.09 | -2.65% | 7 | |
| 2025-08-11 | 2025-08-21 | $339.03 | $320.11 | -1.54% | 9 | |
| 2025-07-31 | 2025-08-01 | $308.27 | $302.63 | -2.86% | 2 | |
| 2025-07-29 | 2025-07-30 | $321.20 | $319.04 | -1.24% | 2 | |
| 2025-07-24 | 2025-07-25 | $305.30 | $316.06 | -6.71% | 2 | |
| 2025-07-21 | 2025-07-23 | $328.49 | $332.56 | 0.44% | 3 | |
| 2025-07-17 | 2025-07-18 | $319.41 | $329.65 | -0.72% | 2 | |
| 2025-06-02 | 2025-06-05 | $342.69 | $284.70 | -3.49% | 4 | |
| 2025-05-22 | 2025-05-28 | $341.04 | $356.90 | 6.58% | 4 | |
| 2025-05-12 | 2025-05-13 | $318.38 | $334.07 | 5.23% | 2 | |
| 2024-10-11 | 2024-10-14 | $217.80 | $219.16 | -7.18% | 2 | |
| 2024-10-09 | 2024-10-10 | $241.05 | $238.77 | -1.29% | 2 | |
| 2024-09-23 | 2024-10-08 | $250.00 | $244.50 | 0.78% | 12 | |
| 2024-09-16 | 2024-09-20 | $226.78 | $238.25 | 4.58% | 5 | |
| 2024-09-05 | 2024-09-09 | $230.17 | $216.27 | -3.25% | 3 | |
| 2024-09-03 | 2024-09-04 | $210.60 | $219.41 | -1.47% | 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-06-25 | 2024-07-03 | $187.35 | $246.39 | 20.77% | 7 | |
| 2024-06-14 | 2024-06-21 | $178.01 | $183.01 | -0.53% | 5 | |
| 2024-01-09 | 2024-01-10 | $234.96 | $233.94 | -1.99% | 2 | |
| 2024-01-05 | 2024-01-08 | $237.49 | $240.45 | -0.31% | 2 | |
| 2023-12-14 | 2024-01-04 | $251.05 | $237.93 | -0.37% | 14 | |
| 2023-11-29 | 2023-12-13 | $244.14 | $239.29 | -3.31% | 11 | |
| 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-11-14 | 2023-11-15 | $237.41 | $242.84 | 4.74% | 2 | |
| 2023-11-08 | 2023-11-09 | $222.11 | $209.98 | -0.19% | 2 | |
| 2023-10-17 | 2023-10-18 | $254.85 | $242.68 | 0.13% | 2 | |
| 2023-10-13 | 2023-10-16 | $251.12 | $253.92 | -2.55% | 2 | |
| 2023-10-11 | 2023-10-12 | $262.99 | $258.87 | -0.35% | 2 | |
| 2023-10-05 | 2023-10-10 | $260.05 | $263.62 | -0.62% | 4 | |
| 2023-10-03 | 2023-10-04 | $246.53 | $261.16 | -1.77% | 2 | |
| 2023-09-12 | 2023-09-22 | $267.48 | $244.88 | -5.39% | 9 | |
| 2023-09-08 | 2023-09-11 | $248.50 | $273.58 | -1.11% | 2 | |
| 2023-09-06 | 2023-09-07 | $251.92 | $251.49 | -1.58% | 2 | |
| 2023-08-30 | 2023-09-05 | $256.90 | $256.49 | -3.94% | 4 | |
| 2023-08-28 | 2023-08-29 | $238.82 | $257.18 | -0.08% | 2 | |
| 2023-08-07 | 2023-08-08 | $251.45 | $249.70 | -0.92% | 2 | |
| 2023-08-03 | 2023-08-04 | $259.32 | $253.86 | 1.48% | 2 | |
| 2023-08-01 | 2023-08-02 | $261.07 | $254.11 | -2.06% | 2 | |
| 2023-07-28 | 2023-07-31 | $266.44 | $267.43 | 3.19% | 2 | |
| 2023-07-26 | 2023-07-27 | $264.35 | $255.71 | -0.44% | 2 | |
| 2023-07-24 | 2023-07-25 | $269.06 | $265.28 | 2.62% | 2 | |
| 2023-06-21 | 2023-07-21 | $259.46 | $260.02 | -3.32% | 22 | |
| 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-05-31 | 2023-06-07 | $203.93 | $224.57 | 7.78% | 6 | |
| 2023-04-03 | 2023-04-06 | $194.77 | $185.06 | -8.66% | 4 | |
| 2023-03-06 | 2023-03-07 | $193.81 | $187.71 | -1.77% | 2 | |
| 2023-02-28 | 2023-03-03 | $205.71 | $197.79 | -6.62% | 4 | |
| 2022-09-20 | 2022-09-23 | $308.73 | $275.33 | -5.47% | 4 | |
| 2022-09-12 | 2022-09-14 | $304.42 | $302.61 | -2.16% | 3 | |
| 2022-08-24 | 2022-08-26 | $297.10 | $288.09 | -0.26% | 3 | |
| 2022-08-02 | 2022-08-23 | $300.59 | $296.45 | -2.05% | 16 | |
| 2022-05-05 | 2022-05-06 | $291.09 | $288.55 | -6.82% | 2 | |
| 2022-04-26 | 2022-04-27 | $292.14 | $293.84 | -9.90% | 2 | |
| 2022-04-22 | 2022-04-25 | $335.02 | $332.67 | -0.46% | 2 | |
| 2022-04-20 | 2022-04-21 | $325.73 | $336.26 | -4.12% | 2 | |
| 2022-04-18 | 2022-04-19 | $334.76 | $342.72 | 1.41% | 2 | |
| 2022-04-13 | 2022-04-14 | $340.79 | $328.33 | 2.71% | 2 | |
| 2022-03-18 | 2022-04-12 | $301.80 | $328.98 | 9.51% | 18 | |
| 2022-03-10 | 2022-03-11 | $279.43 | $265.12 | -2.08% | 2 | |
| 2022-03-04 | 2022-03-07 | $279.43 | $268.19 | -0.26% | 2 | |
| 2022-03-02 | 2022-03-03 | $293.30 | $279.76 | 1.28% | 2 | |
| 2022-02-18 | 2022-02-22 | $285.66 | $273.84 | -1.93% | 2 | |
| 2022-02-16 | 2022-02-17 | $307.80 | $292.12 | -0.08% | 2 | |
| 2022-02-11 | 2022-02-14 | $286.67 | $291.92 | -4.10% | 2 | |
| 2022-02-09 | 2022-02-10 | $310.67 | $301.52 | 0.71% | 2 | |
| 2022-01-03 | 2022-01-04 | $399.93 | $383.20 | 10.66% | 2 | |
| 2021-12-30 | 2021-12-31 | $356.78 | $352.26 | -1.33% | 2 |