LongTermTrend_V1027
ARCHIVEDhybridllmSimplified and strengthened trend entry (require close>sma50, sma50>sma200, positive MACD hist, and non-negative long-term slope) to avoid weak rallies; added a tighter breakout leg (breakout_50 + rel_volume>1.3 + ret_5d>2.5%) to capture real breakouts; improved exits with an explicit sma50 breakdown, a 20-day momentum stop at -2%, and an exit on extreme volatility (vol_pctile>0.85); added regime gates to restrict trading to UPTREND and lower/medium volatility and avoid EXTREME bubble states; reduced base_position to 0.8 to lower sizing and drawdown risk.
Lineage
entry from LongTermTrend_V0521, exit from PriceMomentum_V0817
Strategy Logic (pseudocode)
# LongTermTrend_V1027 [hybrid]
require regime.trend in ['UPTREND']
require regime.volatility in ['LOW_VOLATILITY', 'MEDIUM_VOLATILITY']
require regime.bubble in ['NORMAL', 'EXPENSIVE']
if flat and ((close > sma_50 and sma_50 > sma_200 and macd_hist > 0.0 and sma_200_slope > -0.0024) or (breakout_50 == 1 and rel_volume > 1.3 and ret_5d > 0.025)):
position = 0.8
if long and (close < sma_50 or ret_20d < -0.02 or vol_pctile > 0.85):
position = 0.0 # exit to cashBacktest Metrics
| Metric | Train | Validation | Hidden Test | Full |
|---|---|---|---|---|
| CAGR | 5.1% | 26.3% | 2.4% | 8.6% |
| Total Return | 49.1% | 101.5% | 9.1% | 235.3% |
| Sharpe | 0.42 | 1.29 | 0.22 | 0.59 |
| Sortino | 0.27 | 0.81 | 0.12 | 0.36 |
| Calmar | 0.31 | 0.83 | 0.11 | 0.27 |
| Volatility | 14.1% | 19.6% | 16.8% | 16.1% |
| Max DD | -16.5% | -31.5% | -20.7% | -31.5% |
| Win Rate | 38.7% | 40.0% | 50.0% | 41.5% |
| Avg Win | 6.3% | 28.1% | 7.1% | 11.4% |
| Avg Loss | -2.3% | -4.4% | -5.1% | -3.2% |
| Payoff | 2.78 | 6.37 | 1.38 | 3.51 |
| Expectancy | 1.1% | 8.6% | 1.0% | 2.8% |
| Profit Factor | 1.76 | 4.25 | 1.38 | 2.49 |
| Trades | 31 | 10 | 12 | 53 |
| Avg Holding Days | 11.1 | 14.7 | 12.0 | 12.2 |
| Turnover | 6.3 | 5.3 | 5.1 | 5.8 |
| Exposure | 12.9% | 14.5% | 11.2% | 12.8% |
Growth of $100
Walk-Forward Years
| Year | CAGR | Sharpe | Max DD | Trades |
|---|---|---|---|---|
| 2016 | -3.3% | -0.38 | -8.7% | 3 |
| 2017 | 14.4% | 0.89 | -11.2% | 13 |
| 2018 | -4.9% | -0.81 | -8.6% | 1 |
| 2019 | 13.2% | 1.66 | -3.0% | 0 |
| 2020 | 62.9% | 2.53 | -7.1% | 4 |
| 2021 | 48.6% | 1.81 | -15.2% | 5 |
| 2022 | -19.3% | -1.49 | -19.2% | 1 |
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 | 276 | 0.0% | 0.00 | 0% |
| hidden test | EXPENSIVE | 83 | 48.1% | 1.59 | 41% |
| hidden test | EXTREME | 48 | 0.0% | 0.00 | 0% |
| hidden test | HIGH VOLATILITY | 254 | -7.8% | -0.69 | 1% |
| hidden test | LOW VOLATILITY | 436 | 16.7% | 1.20 | 13% |
| hidden test | MEDIUM VOLATILITY | 250 | -7.0% | -0.29 | 19% |
| hidden test | NORMAL | 809 | -0.6% | -0.04 | 9% |
| hidden test | SIDEWAYS | 293 | -10.1% | -1.40 | 1% |
| hidden test | UPTREND | 371 | 17.5% | 0.67 | 28% |
| train | DOWNTREND | 518 | 0.0% | 0.00 | 0% |
| train | EXPENSIVE | 311 | 43.8% | 1.87 | 30% |
| train | EXTREME | 100 | 9.3% | 1.55 | 1% |
| train | HIGH VOLATILITY | 699 | 10.8% | 0.95 | 1% |
| train | LOW VOLATILITY | 745 | 17.8% | 1.16 | 25% |
| train | MEDIUM VOLATILITY | 568 | -15.5% | -1.01 | 12% |
| train | NORMAL | 1,601 | -1.6% | -0.13 | 10% |
| train | SIDEWAYS | 592 | -1.7% | -0.65 | 0% |
| train | UPTREND | 902 | 14.5% | 0.69 | 28% |
| validation | DOWNTREND | 125 | 0.0% | 0.00 | 0% |
| validation | EXPENSIVE | 138 | 94.1% | 3.12 | 39% |
| validation | EXTREME | 144 | 30.7% | 2.28 | 2% |
| validation | HIGH VOLATILITY | 258 | -9.4% | -1.00 | 0% |
| validation | LOW VOLATILITY | 183 | 26.3% | 2.07 | 21% |
| validation | MEDIUM VOLATILITY | 315 | 53.1% | 1.94 | 23% |
| validation | NORMAL | 474 | 3.6% | 0.21 | 11% |
| validation | SIDEWAYS | 206 | -12.0% | -1.12 | 0% |
| validation | UPTREND | 425 | 50.8% | 2.03 | 26% |
Trades (full period)
| Entry | Exit | Entry Px | Exit Px | Return | Days | |
|---|---|---|---|---|---|---|
| 2025-12-04 | 2026-01-05 | $454.53 | $451.67 | -1.63% | 21 | |
| 2025-09-12 | 2025-11-14 | $395.94 | $404.35 | 7.41% | 46 | |
| 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 | |
| 2024-10-03 | 2024-10-14 | $240.66 | $219.16 | -10.21% | 8 | |
| 2024-09-23 | 2024-09-27 | $250.00 | $260.46 | 5.19% | 5 | |
| 2024-09-16 | 2024-09-20 | $226.78 | $238.25 | 4.58% | 5 | |
| 2024-09-06 | 2024-09-09 | $210.73 | $216.27 | -6.91% | 2 | |
| 2024-07-02 | 2024-07-12 | $231.26 | $248.23 | 11.75% | 8 | |
| 2023-08-30 | 2023-09-05 | $256.90 | $256.49 | -3.94% | 4 | |
| 2023-06-08 | 2023-08-02 | $234.86 | $254.11 | 13.00% | 38 | |
| 2022-04-05 | 2022-04-27 | $363.75 | $293.84 | -19.20% | 16 | |
| 2021-12-30 | 2021-12-31 | $356.78 | $352.26 | -1.33% | 2 | |
| 2021-12-28 | 2021-12-29 | $362.82 | $362.06 | -0.56% | 2 | |
| 2021-08-31 | 2021-11-10 | $245.24 | $355.98 | 31.27% | 51 | |
| 2021-01-12 | 2021-02-11 | $283.15 | $270.55 | -0.64% | 22 | |
| 2020-12-10 | 2021-01-11 | $209.02 | $270.40 | 35.18% | 21 | |
| 2020-11-19 | 2020-12-08 | $166.42 | $216.63 | 24.77% | 13 | |
| 2020-11-09 | 2020-11-10 | $140.42 | $136.79 | -1.78% | 2 | |
| 2020-10-14 | 2020-10-20 | $153.77 | $140.65 | -2.98% | 5 | |
| 2019-12-16 | 2020-01-22 | $25.43 | $37.97 | 40.42% | 25 | |
| 2018-12-04 | 2018-12-19 | $23.98 | $22.20 | -4.93% | 11 | |
| 2017-10-18 | 2017-10-19 | $23.98 | $23.45 | 0.72% | 2 | |
| 2017-10-16 | 2017-10-17 | $23.37 | $23.72 | -1.28% | 2 | |
| 2017-10-12 | 2017-10-13 | $23.71 | $23.70 | 0.08% | 2 | |
| 2017-09-18 | 2017-09-26 | $25.67 | $23.02 | -7.53% | 7 | |
| 2017-08-15 | 2017-08-18 | $24.16 | $23.16 | -2.77% | 4 | |
| 2017-08-04 | 2017-08-07 | $23.79 | $23.68 | 2.10% | 2 | |
| 2017-06-05 | 2017-06-14 | $23.15 | $25.38 | 8.28% | 8 | |
| 2017-05-15 | 2017-05-19 | $21.06 | $20.72 | -3.04% | 5 | |
| 2017-05-02 | 2017-05-10 | $21.26 | $21.68 | -0.49% | 7 | |
| 2017-04-20 | 2017-04-21 | $20.17 | $20.37 | -0.95% | 2 | |
| 2017-03-24 | 2017-04-04 | $17.54 | $20.25 | 13.40% | 8 | |
| 2017-03-20 | 2017-03-21 | $17.46 | $16.71 | -0.03% | 2 | |
| 2017-01-05 | 2017-02-28 | $15.12 | $16.67 | 6.69% | 37 | |
| 2016-07-26 | 2016-08-18 | $15.30 | $14.90 | -2.50% | 18 | |
| 2016-06-08 | 2016-06-09 | $15.70 | $15.29 | 0.93% | 2 | |
| 2016-04-05 | 2016-05-03 | $17.03 | $15.49 | -1.78% | 21 | |
| 2015-06-09 | 2015-07-28 | $17.07 | $17.65 | -1.05% | 35 | |
| 2014-10-08 | 2014-10-09 | $17.29 | $17.13 | -0.25% | 2 | |
| 2014-08-04 | 2014-09-16 | $15.90 | $17.38 | 7.00% | 31 | |
| 2014-07-31 | 2014-08-01 | $14.89 | $15.55 | -2.12% | 2 | |
| 2014-06-23 | 2014-07-16 | $15.81 | $14.48 | -3.59% | 17 | |
| 2014-02-13 | 2014-02-26 | $13.31 | $16.87 | 21.13% | 9 | |
| 2013-09-09 | 2013-10-22 | $10.71 | $11.44 | 2.74% | 32 | |
| 2013-03-27 | 2013-04-02 | $2.54 | $2.96 | 12.65% | 4 | |
| 2013-03-12 | 2013-03-15 | $2.61 | $2.35 | -4.76% | 4 | |
| 2013-03-08 | 2013-03-11 | $2.56 | $2.61 | 0.34% | 2 | |
| 2013-01-23 | 2013-02-22 | $2.40 | $2.41 | -0.08% | 22 | |
| 2012-12-04 | 2012-12-14 | $2.26 | $2.25 | -2.47% | 9 | |
| 2012-02-23 | 2012-04-10 | $2.30 | $2.16 | -2.46% | 33 | |
| 2012-02-21 | 2012-02-22 | $2.30 | $2.28 | -1.23% | 2 |