LongTermTrend_V1244
ARCHIVEDhybridllm1) Added an explicit uptrend regime gate and excluded high-volatility and bubble extremes to reduce regime mismatch. 2) Replaced noisy close>200sma check with smoother sma_50>sma_200 trend filter and kept a ret_20d breakout OR path for momentum entries. 3) Added MACD histogram momentum filter and a vol_pctile ceiling to avoid entering into extreme volatility. 4) Loosened long-term cumret threshold slightly and tightened short-term exit to ret_20d < -3% or negative 50-day slope for crisper exits. 5) Reduced base_position to 0.6 to lower drawdown risk while preserving exposure.
Lineage
entry from LongTermTrend_V0605, exit from PriceMomentum_V0828
Strategy Logic (pseudocode)
# LongTermTrend_V1244 [hybrid]
require regime.trend in ['UPTREND']
require regime.volatility in ['LOW_VOLATILITY', 'MEDIUM_VOLATILITY']
require regime.bubble in ['NORMAL']
if flat and ((sma_50 > sma_200 or ret_20d > 0.1) and ret_20d > 0.04 and cumret_252d > -0.25 and macd_hist > 0.0 and vol_pctile < 0.85):
position = 0.6
if long and (ret_20d < -0.03 or sma_50_slope < 0.0):
position = 0.0 # exit to cashBacktest Metrics
| Metric | Train | Validation | Hidden Test | Full |
|---|---|---|---|---|
| CAGR | 0.6% | -1.6% | 2.2% | 0.5% |
| Total Return | 4.9% | -4.7% | 8.3% | 8.3% |
| Sharpe | 0.12 | -0.09 | 0.24 | 0.10 |
| Sortino | 0.06 | -0.04 | 0.10 | 0.05 |
| Calmar | 0.05 | -0.06 | 0.11 | 0.02 |
| Volatility | 7.6% | 10.7% | 11.5% | 9.4% |
| Max DD | -12.7% | -28.4% | -19.5% | -28.4% |
| Win Rate | 43.8% | 20.0% | 58.3% | 45.5% |
| Avg Win | 3.9% | 22.8% | 5.1% | 5.7% |
| Avg Loss | -2.4% | -6.0% | -5.0% | -3.9% |
| Payoff | 1.64 | 3.80 | 1.02 | 1.46 |
| Expectancy | 0.4% | -0.2% | 0.9% | 0.5% |
| Profit Factor | 1.28 | 0.95 | 1.42 | 1.22 |
| Trades | 16 | 5 | 12 | 33 |
| Avg Holding Days | 14.8 | 16.6 | 8.3 | 12.7 |
| Turnover | 2.4 | 2.0 | 3.8 | 2.7 |
| Exposure | 6.6% | 6.2% | 5.6% | 6.3% |
Growth of $100
Walk-Forward Years
| Year | CAGR | Sharpe | Max DD | Trades |
|---|---|---|---|---|
| 2016 | -4.8% | -0.72 | -8.8% | 3 |
| 2017 | 7.2% | 2.04 | -0.6% | 2 |
| 2018 | -8.6% | -1.85 | -8.5% | 2 |
| 2019 | 0.0% | 0.00 | 0.0% | 0 |
| 2020 | 0.0% | 0.00 | 0.0% | 0 |
| 2021 | 19.5% | 1.28 | -10.3% | 2 |
| 2022 | -20.3% | -1.98 | -20.2% | 3 |
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 | 0.0% | 0.00 | 0% |
| hidden test | EXPENSIVE | 83 | 12.5% | 1.72 | 1% |
| hidden test | EXTREME | 48 | 0.0% | 0.00 | 0% |
| hidden test | HIGH VOLATILITY | 254 | -14.3% | -1.20 | 1% |
| hidden test | LOW VOLATILITY | 439 | 5.6% | 0.62 | 7% |
| hidden test | MEDIUM VOLATILITY | 250 | 15.3% | 1.06 | 7% |
| hidden test | NORMAL | 812 | 2.0% | 0.16 | 6% |
| hidden test | SIDEWAYS | 294 | -10.1% | -1.24 | 1% |
| hidden test | UPTREND | 371 | 15.1% | 0.90 | 14% |
| train | DOWNTREND | 518 | 0.0% | 0.00 | 0% |
| train | EXPENSIVE | 311 | 2.2% | 1.41 | 1% |
| train | EXTREME | 100 | 0.0% | 0.00 | 0% |
| train | HIGH VOLATILITY | 699 | 3.4% | 0.60 | 0% |
| train | LOW VOLATILITY | 745 | 5.6% | 0.60 | 15% |
| train | MEDIUM VOLATILITY | 568 | -8.5% | -1.24 | 4% |
| train | NORMAL | 1,601 | 0.7% | 0.08 | 8% |
| train | SIDEWAYS | 592 | -2.8% | -1.11 | 1% |
| train | UPTREND | 902 | 3.8% | 0.34 | 14% |
| validation | DOWNTREND | 125 | 0.0% | 0.00 | 0% |
| validation | EXPENSIVE | 138 | 0.0% | 0.00 | 0% |
| validation | EXTREME | 144 | 0.0% | 0.00 | 0% |
| validation | HIGH VOLATILITY | 258 | -7.1% | -1.00 | 0% |
| validation | LOW VOLATILITY | 183 | 12.4% | 1.41 | 16% |
| validation | MEDIUM VOLATILITY | 315 | -3.9% | -0.28 | 6% |
| validation | NORMAL | 474 | -1.6% | -0.12 | 10% |
| validation | SIDEWAYS | 206 | -14.9% | -1.59 | 1% |
| validation | UPTREND | 425 | 5.4% | 0.42 | 10% |
Trades (full period)
| Entry | Exit | Entry Px | Exit Px | Return | Days | |
|---|---|---|---|---|---|---|
| 2026-05-29 | 2026-06-01 | $435.79 | $415.88 | -0.98% | 2 | |
| 2025-12-15 | 2026-01-07 | $475.31 | $431.41 | -3.43% | 16 | |
| 2025-07-31 | 2025-08-01 | $308.27 | $302.63 | -2.14% | 2 | |
| 2025-06-02 | 2025-06-06 | $342.69 | $295.14 | -10.95% | 5 | |
| 2025-05-22 | 2025-05-28 | $341.04 | $356.90 | 4.92% | 4 | |
| 2024-10-03 | 2024-10-14 | $240.66 | $219.16 | -7.69% | 8 | |
| 2024-09-25 | 2024-09-26 | $257.02 | $254.22 | 0.53% | 2 | |
| 2024-09-23 | 2024-09-24 | $250.00 | $254.27 | 2.84% | 2 | |
| 2024-09-16 | 2024-09-20 | $226.78 | $238.25 | 3.45% | 5 | |
| 2024-09-04 | 2024-09-09 | $219.41 | $216.27 | 0.06% | 4 | |
| 2024-07-02 | 2024-07-12 | $231.26 | $248.23 | 8.84% | 8 | |
| 2023-06-02 | 2023-08-02 | $213.97 | $254.11 | 15.23% | 42 | |
| 2022-08-16 | 2022-08-22 | $306.56 | $289.91 | -2.59% | 5 | |
| 2022-08-05 | 2022-08-08 | $288.17 | $290.42 | -4.10% | 2 | |
| 2022-04-05 | 2022-04-27 | $363.75 | $293.84 | -14.61% | 16 | |
| 2021-09-07 | 2021-11-10 | $250.97 | $355.98 | 22.77% | 47 | |
| 2021-08-05 | 2021-08-23 | $238.21 | $235.43 | -2.66% | 13 | |
| 2018-12-12 | 2018-12-19 | $24.44 | $22.20 | -5.00% | 6 | |
| 2018-02-01 | 2018-02-06 | $23.28 | $22.26 | -3.73% | 4 | |
| 2017-01-31 | 2017-02-03 | $16.80 | $16.76 | 0.10% | 4 | |
| 2017-01-05 | 2017-01-25 | $15.12 | $16.96 | 7.04% | 14 | |
| 2016-07-26 | 2016-08-23 | $15.30 | $14.99 | -1.95% | 21 | |
| 2016-06-08 | 2016-06-09 | $15.70 | $15.29 | 0.70% | 2 | |
| 2016-04-05 | 2016-05-04 | $17.03 | $14.84 | -3.61% | 22 | |
| 2015-05-11 | 2015-07-28 | $15.97 | $17.65 | 4.23% | 55 | |
| 2015-04-29 | 2015-05-01 | $15.50 | $15.07 | -1.27% | 3 | |
| 2014-08-05 | 2014-09-16 | $15.90 | $17.38 | 3.93% | 30 | |
| 2014-06-23 | 2014-07-17 | $15.81 | $14.36 | -3.30% | 18 | |
| 2013-03-27 | 2013-04-02 | $2.54 | $2.96 | 9.49% | 4 | |
| 2013-02-12 | 2013-02-14 | $2.53 | $2.55 | -0.07% | 3 | |
| 2012-11-23 | 2012-12-14 | $2.14 | $2.25 | 2.04% | 16 | |
| 2012-02-23 | 2012-04-10 | $2.30 | $2.16 | -1.69% | 33 | |
| 2012-02-21 | 2012-02-22 | $2.30 | $2.28 | -0.93% | 2 |