LongTermTrend_V1397
ARCHIVEDhybridllmSimplified and generalized entry (use sma_50 + slope or moderate 20d return) to avoid overfit to extreme ret_20d thresholds; add MACD momentum and cap extreme vol percentiles to reduce false signals. Replace fragile single ret_20d exit with a composite exit: 3% stop, trend/momentum-based exit (close below sma_50 with negative macd_hist), and a take-profit at 25%. Add regime gates to avoid clear downtrends and extreme bubble conditions. Add position rules to scale down size in HIGH_VOLATILITY and slightly reduce in EXPENSIVE bubble to improve robustness in validation.
Lineage
entry = LongTermTrend_V0605 OR PriceMomentum_V1003
Strategy Logic (pseudocode)
# LongTermTrend_V1397 [hybrid]
require regime.trend in ['UPTREND', 'SIDEWAYS']
require regime.bubble in ['NORMAL', 'EXPENSIVE']
if flat and (((close > sma_50 and sma_50_slope > 0.0) or ret_20d > 0.08) and macd_hist > 0.0 and vol_pctile < 0.95):
position = 1.0
if long and (ret_20d < -0.03 or (close < sma_50 and macd_hist < 0.0) or ret_20d > 0.25):
position = 0.0 # exit to cashBacktest Metrics
| Metric | Train | Validation | Hidden Test | Full |
|---|---|---|---|---|
| CAGR | 8.4% | 36.8% | -14.2% | 7.3% |
| Total Return | 90.9% | 156.0% | -43.8% | 182.2% |
| Sharpe | 0.44 | 1.44 | -0.45 | 0.40 |
| Sortino | 0.39 | 1.47 | -0.33 | 0.34 |
| Calmar | 0.18 | 1.70 | -0.32 | 0.13 |
| Volatility | 26.1% | 23.6% | 26.1% | 25.6% |
| Max DD | -47.5% | -21.7% | -44.7% | -56.0% |
| Win Rate | 46.5% | 58.7% | 46.8% | 49.7% |
| Avg Win | 6.6% | 6.5% | 5.1% | 6.1% |
| Avg Loss | -3.8% | -3.4% | -5.6% | -4.4% |
| Payoff | 1.72 | 1.90 | 0.91 | 1.40 |
| Expectancy | 1.0% | 2.4% | -0.6% | 0.8% |
| Profit Factor | 1.50 | 2.70 | 0.80 | 1.38 |
| Trades | 86 | 46 | 62 | 195 |
| Avg Holding Days | 8.8 | 5.1 | 4.6 | 6.6 |
| Turnover | 21.5 | 30.7 | 33.3 | 26.5 |
| Exposure | 33.5% | 24.7% | 24.1% | 29.4% |
Growth of $100
Walk-Forward Years
| Year | CAGR | Sharpe | Max DD | Trades |
|---|---|---|---|---|
| 2016 | -9.2% | -0.57 | -19.6% | 7 |
| 2017 | 27.4% | 1.11 | -17.8% | 13 |
| 2018 | -14.0% | -0.63 | -20.8% | 13 |
| 2019 | 7.9% | 0.40 | -26.6% | 17 |
| 2020 | 73.8% | 2.93 | -8.8% | 17 |
| 2021 | 59.7% | 1.90 | -10.6% | 16 |
| 2022 | -21.9% | -1.15 | -21.8% | 13 |
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.5% | -0.95 | 0% |
| hidden test | EXPENSIVE | 83 | 67.7% | 2.28 | 25% |
| hidden test | EXTREME | 48 | 19.4% | 2.29 | 2% |
| hidden test | HIGH VOLATILITY | 254 | -44.7% | -1.57 | 10% |
| hidden test | LOW VOLATILITY | 441 | 28.2% | 1.28 | 32% |
| hidden test | MEDIUM VOLATILITY | 250 | -49.3% | -1.65 | 25% |
| hidden test | NORMAL | 814 | -21.8% | -0.83 | 25% |
| hidden test | SIDEWAYS | 296 | -33.8% | -1.10 | 36% |
| hidden test | UPTREND | 371 | -2.2% | -0.07 | 33% |
| train | DOWNTREND | 518 | -8.1% | -1.42 | 2% |
| train | EXPENSIVE | 311 | 87.9% | 2.61 | 59% |
| train | EXTREME | 100 | 55.2% | 2.28 | 3% |
| train | HIGH VOLATILITY | 699 | 20.4% | 0.70 | 19% |
| train | LOW VOLATILITY | 745 | 32.2% | 1.37 | 50% |
| train | MEDIUM VOLATILITY | 568 | -26.7% | -1.05 | 30% |
| train | NORMAL | 1,601 | -6.1% | -0.25 | 30% |
| train | SIDEWAYS | 592 | -19.0% | -0.78 | 31% |
| train | UPTREND | 902 | 42.7% | 1.29 | 54% |
| validation | DOWNTREND | 125 | 0.0% | 0.00 | 0% |
| validation | EXPENSIVE | 138 | 114.7% | 4.36 | 26% |
| validation | EXTREME | 144 | 24.2% | 1.84 | 1% |
| validation | HIGH VOLATILITY | 258 | -1.6% | -0.09 | 3% |
| validation | LOW VOLATILITY | 183 | 24.8% | 1.04 | 56% |
| validation | MEDIUM VOLATILITY | 315 | 68.7% | 2.52 | 24% |
| validation | NORMAL | 474 | 13.6% | 0.54 | 31% |
| validation | SIDEWAYS | 206 | -10.3% | -0.47 | 31% |
| validation | UPTREND | 425 | 65.6% | 2.39 | 29% |
Trades (full period)
| Entry | Exit | Entry Px | Exit Px | Return | Days | |
|---|---|---|---|---|---|---|
| 2026-10-07 | — | $377.81 | — | -1.59% | 2 | OPEN |
| 2026-07-07 | 2026-07-09 | $402.90 | $406.55 | -6.32% | 3 | |
| 2026-07-01 | 2026-07-06 | $425.30 | $419.77 | -6.64% | 3 | |
| 2026-05-13 | 2026-06-08 | $445.27 | $408.95 | -9.97% | 18 | |
| 2026-05-08 | 2026-05-12 | $428.35 | $433.45 | 7.85% | 3 | |
| 2025-12-04 | 2026-01-05 | $454.53 | $451.67 | -2.14% | 21 | |
| 2025-11-04 | 2025-11-14 | $444.26 | $404.35 | -14.35% | 9 | |
| 2025-10-02 | 2025-10-03 | $436.00 | $429.83 | -5.30% | 2 | |
| 2025-09-30 | 2025-10-01 | $444.72 | $459.46 | 0.14% | 2 | |
| 2025-09-26 | 2025-09-29 | $440.40 | $443.21 | 3.81% | 2 | |
| 2025-09-24 | 2025-09-25 | $442.79 | $423.39 | 3.77% | 2 | |
| 2025-09-22 | 2025-09-23 | $434.21 | $425.85 | 1.71% | 2 | |
| 2025-09-18 | 2025-09-19 | $416.85 | $426.07 | -2.31% | 2 | |
| 2025-08-25 | 2025-09-17 | $346.60 | $425.86 | 23.76% | 17 | |
| 2025-08-13 | 2025-08-21 | $339.38 | $320.11 | -5.16% | 7 | |
| 2025-07-29 | 2025-08-01 | $321.20 | $302.63 | -5.51% | 4 | |
| 2025-07-24 | 2025-07-25 | $305.30 | $316.06 | -8.39% | 2 | |
| 2025-07-21 | 2025-07-23 | $328.49 | $332.56 | 0.54% | 3 | |
| 2025-06-25 | 2025-06-26 | $327.55 | $325.78 | -3.99% | 2 | |
| 2025-06-02 | 2025-06-06 | $342.69 | $295.14 | -17.99% | 5 | |
| 2025-05-29 | 2025-05-30 | $358.43 | $346.46 | 0.23% | 2 | |
| 2025-05-27 | 2025-05-28 | $362.89 | $356.90 | 6.73% | 2 | |
| 2025-05-22 | 2025-05-23 | $341.04 | $339.34 | 1.72% | 2 | |
| 2025-05-20 | 2025-05-21 | $343.82 | $334.62 | 0.31% | 2 | |
| 2025-05-16 | 2025-05-19 | $349.98 | $342.09 | 1.89% | 2 | |
| 2025-05-14 | 2025-05-15 | $347.68 | $342.82 | 3.87% | 2 | |
| 2025-05-12 | 2025-05-13 | $318.38 | $334.07 | 6.54% | 2 | |
| 2024-11-26 | 2024-11-27 | $338.23 | $332.89 | -0.31% | 2 | |
| 2024-11-22 | 2024-11-25 | $352.56 | $338.59 | 3.60% | 2 | |
| 2024-10-01 | 2024-10-14 | $258.02 | $219.16 | -16.92% | 10 | |
| 2024-09-05 | 2024-09-30 | $230.17 | $261.63 | 18.48% | 18 | |
| 2024-08-26 | 2024-08-27 | $213.21 | $209.21 | -3.42% | 2 | |
| 2024-08-22 | 2024-08-23 | $210.66 | $220.32 | -5.84% | 2 | |
| 2024-08-20 | 2024-08-21 | $221.10 | $223.27 | -0.93% | 2 | |
| 2024-07-19 | 2024-07-22 | $239.20 | $251.51 | -4.22% | 2 | |
| 2024-07-17 | 2024-07-18 | $248.50 | $249.23 | -3.34% | 2 | |
| 2024-07-15 | 2024-07-16 | $252.64 | $256.56 | 1.57% | 2 | |
| 2024-07-11 | 2024-07-12 | $241.03 | $248.23 | -8.64% | 2 | |
| 2024-07-09 | 2024-07-10 | $262.33 | $263.26 | 3.51% | 2 | |
| 2024-07-05 | 2024-07-08 | $251.52 | $252.94 | 1.88% | 2 | |
| 2024-06-17 | 2024-07-03 | $187.44 | $246.39 | 29.66% | 12 | |
| 2024-05-29 | 2024-05-30 | $176.19 | $178.79 | -0.52% | 2 | |
| 2023-11-30 | 2024-01-10 | $240.08 | $233.94 | -3.95% | 28 | |
| 2023-11-20 | 2023-11-29 | $235.60 | $244.14 | 5.09% | 7 | |
| 2023-09-19 | 2023-09-25 | $266.50 | $246.99 | -7.87% | 5 | |
| 2023-09-12 | 2023-09-18 | $267.48 | $265.28 | 0.09% | 5 | |
| 2023-07-06 | 2023-08-02 | $276.54 | $254.11 | -7.77% | 20 | |
| 2023-06-23 | 2023-06-26 | $256.60 | $241.05 | -3.22% | 2 | |
| 2023-06-21 | 2023-06-22 | $259.46 | $264.61 | -5.66% | 2 | |
| 2023-06-16 | 2023-06-20 | $260.54 | $274.45 | 1.61% | 2 | |
| 2023-06-14 | 2023-06-15 | $256.79 | $255.90 | -0.94% | 2 | |
| 2023-06-12 | 2023-06-13 | $249.83 | $258.71 | 2.02% | 2 | |
| 2023-06-08 | 2023-06-09 | $234.86 | $244.40 | 4.38% | 2 | |
| 2023-06-06 | 2023-06-07 | $221.31 | $224.57 | 1.50% | 2 | |
| 2023-06-02 | 2023-06-05 | $213.97 | $217.61 | 2.91% | 2 | |
| 2023-05-31 | 2023-06-01 | $203.93 | $207.52 | 1.18% | 2 | |
| 2023-03-30 | 2023-04-06 | $195.28 | $185.06 | -4.50% | 6 | |
| 2023-03-28 | 2023-03-29 | $189.19 | $193.88 | -1.56% | 2 | |
| 2023-03-24 | 2023-03-27 | $190.41 | $191.81 | -1.14% | 2 | |
| 2023-02-21 | 2023-02-22 | $197.37 | $200.86 | -5.45% | 2 | |
| 2023-02-16 | 2023-02-17 | $202.04 | $208.31 | -5.89% | 2 | |
| 2023-02-14 | 2023-02-15 | $209.25 | $214.24 | 7.30% | 2 | |
| 2023-02-10 | 2023-02-13 | $196.89 | $194.64 | -5.23% | 2 | |
| 2022-09-15 | 2022-09-26 | $303.75 | $276.01 | -9.20% | 8 | |
| 2022-09-13 | 2022-09-14 | $292.13 | $302.61 | -4.23% | 2 | |
| 2022-08-17 | 2022-08-29 | $304.00 | $284.82 | -6.21% | 9 | |
| 2022-08-08 | 2022-08-16 | $290.42 | $306.56 | 7.13% | 7 | |
| 2022-08-04 | 2022-08-05 | $308.63 | $288.17 | 0.20% | 2 | |
| 2022-08-02 | 2022-08-03 | $300.59 | $307.40 | 0.91% | 2 | |
| 2022-04-06 | 2022-04-08 | $348.59 | $341.83 | -3.31% | 3 | |
| 2022-04-04 | 2022-04-05 | $381.82 | $363.75 | 5.41% | 2 | |
| 2022-03-30 | 2022-04-01 | $364.66 | $361.53 | -2.19% | 3 | |
| 2022-03-25 | 2022-03-29 | $336.88 | $366.52 | 7.47% | 3 | |
| 2022-03-23 | 2022-03-24 | $333.04 | $337.97 | 0.32% | 2 | |
| 2022-01-13 | 2022-01-14 | $343.85 | $349.87 | -6.94% | 2 | |
| 2021-12-30 | 2022-01-12 | $356.78 | $368.74 | -2.20% | 10 | |
| 2021-12-28 | 2021-12-29 | $362.82 | $362.06 | -0.70% | 2 | |
| 2021-11-10 | 2021-11-11 | $355.98 | $354.50 | 4.14% | 2 | |
| 2021-11-08 | 2021-11-09 | $387.65 | $341.17 | -5.04% | 2 | |
| 2021-11-04 | 2021-11-05 | $409.97 | $407.36 | 1.12% | 2 | |
| 2021-11-02 | 2021-11-03 | $390.67 | $404.62 | -3.22% | 2 | |
| 2021-10-29 | 2021-11-01 | $371.33 | $402.86 | 3.23% | 2 | |
| 2021-10-27 | 2021-10-28 | $345.95 | $359.01 | 1.71% | 2 | |
| 2021-08-02 | 2021-10-26 | $236.56 | $339.48 | 48.84% | 61 | |
| 2021-06-18 | 2021-07-26 | $207.77 | $219.21 | 4.14% | 26 | |
| 2021-04-15 | 2021-04-30 | $246.28 | $236.48 | -7.73% | 12 | |
| 2021-04-06 | 2021-04-12 | $230.54 | $233.99 | -2.23% | 5 | |
| 2021-01-21 | 2021-01-22 | $281.66 | $282.21 | -0.84% | 2 | |
| 2021-01-19 | 2021-01-20 | $281.52 | $283.48 | 2.02% | 2 | |
| 2021-01-14 | 2021-01-15 | $281.67 | $275.39 | -1.30% | 2 | |
| 2021-01-12 | 2021-01-13 | $283.15 | $284.80 | 4.51% | 2 | |
| 2020-12-22 | 2021-01-08 | $213.45 | $293.34 | 25.32% | 12 | |
| 2020-12-18 | 2020-12-21 | $231.67 | $216.62 | 5.76% | 2 | |
| 2020-12-16 | 2020-12-17 | $207.59 | $218.63 | -1.85% | 2 | |
| 2020-12-14 | 2020-12-15 | $213.28 | $211.08 | 4.69% | 2 | |
| 2020-12-10 | 2020-12-11 | $209.02 | $203.33 | 3.53% | 2 | |
| 2020-12-07 | 2020-12-08 | $213.92 | $216.63 | 6.92% | 2 | |
| 2020-12-03 | 2020-12-04 | $197.79 | $199.68 | 4.11% | 2 | |
| 2020-12-01 | 2020-12-02 | $194.92 | $189.61 | 2.82% | 2 | |
| 2020-11-27 | 2020-11-30 | $195.25 | $189.20 | 1.85% | 2 |