LongTermTrend_V0903
ARCHIVEDhybridllmAdded regime gates to avoid high-volatility and extreme-bubble environments; simplified and consolidated entry rules to focus on 200-day trend confirmation and strong momentum/volume breakouts; tightened slope and cumulative-return filters to reduce chasing bad regimes; replaced fragile single-day exit with multi-condition exit (larger 20d stop, MACD + sma_50 weakness, and drawdown cap) to limit prolonged drawdowns; added volatility-based position sizing (vol_pctile tiers) and lowered base position to reduce risk in uncertain periods.
Lineage
entry from LongTermTrend_V0583, exit from PriceMomentum_V0690
Strategy Logic (pseudocode)
# LongTermTrend_V0903 [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.0015 and ret_20d > 0.04 and cumret_252d > -0.15 and dist_sma_50 > -0.1) or ((macd_hist > 0.0 and close > sma_50 and sma_50 > sma_200) or (breakout_50 == 1 and rel_volume > 1.6))):
position = 0.8
if long and (ret_20d < -0.05 or (macd_hist < 0.0 and close < sma_50) or drawdown > 0.12):
position = 0.0 # exit to cashBacktest Metrics
| Metric | Train | Validation | Hidden Test | Full |
|---|---|---|---|---|
| CAGR | -2.1% | 1.0% | -4.4% | -2.1% |
| Total Return | -15.9% | 3.1% | -15.5% | -26.7% |
| Sharpe | -0.07 | 0.15 | -0.14 | -0.04 |
| Sortino | -0.05 | 0.10 | -0.09 | -0.03 |
| Calmar | -0.06 | 0.03 | -0.15 | -0.04 |
| Volatility | 14.7% | 19.6% | 18.8% | 16.9% |
| Max DD | -37.4% | -33.6% | -29.3% | -47.7% |
| Win Rate | 39.5% | 30.8% | 30.0% | 35.2% |
| Avg Win | 4.5% | 12.8% | 7.1% | 6.4% |
| Avg Loss | -3.5% | -4.6% | -4.0% | -3.8% |
| Payoff | 1.29 | 2.79 | 1.79 | 1.68 |
| Expectancy | -0.3% | 0.8% | -0.6% | -0.2% |
| Profit Factor | 0.84 | 1.24 | 0.77 | 0.91 |
| Trades | 38 | 13 | 20 | 71 |
| Avg Holding Days | 12.3 | 14.5 | 10.6 | 12.2 |
| Turnover | 7.6 | 6.9 | 8.6 | 7.7 |
| Exposure | 17.1% | 18.5% | 16.4% | 17.2% |
Growth of $100
Walk-Forward Years
| Year | CAGR | Sharpe | Max DD | Trades |
|---|---|---|---|---|
| 2016 | -10.4% | -0.83 | -16.9% | 4 |
| 2017 | 9.5% | 1.04 | -4.9% | 8 |
| 2018 | -15.0% | -1.31 | -15.8% | 3 |
| 2019 | 5.9% | 0.73 | -5.9% | 1 |
| 2020 | 0.0% | 0.00 | 0.0% | 0 |
| 2021 | 12.8% | 0.61 | -20.2% | 7 |
| 2022 | -17.5% | -0.82 | -33.6% | 5 |
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 | 274 | -2.8% | -1.38 | 1% |
| hidden test | EXPENSIVE | 83 | 34.2% | 2.44 | 2% |
| hidden test | EXTREME | 48 | 0.0% | 0.00 | 0% |
| hidden test | HIGH VOLATILITY | 254 | -13.9% | -0.83 | 2% |
| hidden test | LOW VOLATILITY | 434 | 1.7% | 0.10 | 24% |
| hidden test | MEDIUM VOLATILITY | 250 | 1.0% | 0.04 | 18% |
| hidden test | NORMAL | 807 | -6.7% | -0.34 | 19% |
| hidden test | SIDEWAYS | 293 | -21.1% | -0.93 | 26% |
| hidden test | UPTREND | 371 | 11.9% | 0.54 | 20% |
| train | DOWNTREND | 518 | -5.1% | -1.21 | 1% |
| train | EXPENSIVE | 311 | 10.9% | 1.90 | 2% |
| train | EXTREME | 100 | 0.0% | 0.00 | 0% |
| train | HIGH VOLATILITY | 699 | -1.8% | -0.17 | 1% |
| train | LOW VOLATILITY | 745 | 15.7% | 0.92 | 33% |
| train | MEDIUM VOLATILITY | 568 | -22.3% | -1.42 | 16% |
| train | NORMAL | 1,601 | -3.5% | -0.21 | 21% |
| train | SIDEWAYS | 592 | -8.7% | -0.60 | 16% |
| train | UPTREND | 902 | 6.1% | 0.34 | 27% |
| 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 | 4.0% | 0.27 | 1% |
| validation | LOW VOLATILITY | 183 | 9.0% | 0.48 | 45% |
| validation | MEDIUM VOLATILITY | 315 | -1.4% | -0.06 | 18% |
| validation | NORMAL | 474 | 4.7% | 0.19 | 30% |
| validation | SIDEWAYS | 206 | -27.1% | -1.17 | 28% |
| validation | UPTREND | 425 | 18.4% | 0.89 | 19% |
Trades (full period)
| Entry | Exit | Entry Px | Exit Px | Return | Days | |
|---|---|---|---|---|---|---|
| 2026-05-08 | 2026-06-08 | $428.35 | $408.95 | -4.08% | 21 | |
| 2026-04-20 | 2026-04-21 | $392.50 | $386.42 | -1.78% | 2 | |
| 2025-12-04 | 2026-01-05 | $454.53 | $451.67 | -1.63% | 21 | |
| 2025-08-25 | 2025-09-15 | $346.60 | $410.04 | 12.89% | 15 | |
| 2025-08-11 | 2025-08-21 | $339.03 | $320.11 | -1.54% | 9 | |
| 2025-07-29 | 2025-08-01 | $321.20 | $302.63 | -4.42% | 4 | |
| 2025-07-21 | 2025-07-25 | $328.49 | $316.06 | -6.05% | 5 | |
| 2025-06-02 | 2025-06-06 | $342.69 | $295.14 | -14.50% | 5 | |
| 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-09-23 | 2024-10-14 | $250.00 | $219.16 | -6.94% | 16 | |
| 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-07-02 | 2024-07-12 | $231.26 | $248.23 | 11.75% | 8 | |
| 2023-11-16 | 2024-01-10 | $233.59 | $233.94 | -2.64% | 37 | |
| 2023-10-16 | 2023-10-19 | $253.92 | $220.11 | -2.83% | 4 | |
| 2023-10-11 | 2023-10-13 | $262.99 | $251.12 | -1.60% | 3 | |
| 2023-10-06 | 2023-10-10 | $260.53 | $263.62 | -0.28% | 3 | |
| 2023-08-30 | 2023-09-25 | $256.90 | $246.99 | -3.85% | 18 | |
| 2023-06-26 | 2023-08-02 | $241.05 | $254.11 | 1.46% | 27 | |
| 2022-09-20 | 2022-09-26 | $308.73 | $276.01 | -8.95% | 5 | |
| 2022-09-12 | 2022-09-14 | $304.42 | $302.61 | -2.16% | 3 | |
| 2022-08-04 | 2022-08-31 | $308.63 | $275.61 | -7.85% | 20 | |
| 2022-03-21 | 2022-04-27 | $307.05 | $293.84 | -2.35% | 27 | |
| 2022-01-12 | 2022-01-13 | $368.74 | $343.85 | 2.98% | 2 | |
| 2021-12-31 | 2022-01-04 | $352.26 | $383.20 | 9.53% | 3 | |
| 2021-12-28 | 2021-12-30 | $362.82 | $356.78 | -0.73% | 3 | |
| 2021-12-09 | 2021-12-10 | $334.60 | $339.01 | -5.03% | 2 | |
| 2021-11-23 | 2021-12-01 | $369.68 | $365.00 | -0.96% | 6 | |
| 2021-08-03 | 2021-11-10 | $236.58 | $355.98 | 34.50% | 71 | |
| 2021-06-14 | 2021-07-26 | $205.90 | $219.21 | 4.30% | 30 | |
| 2021-05-03 | 2021-05-05 | $228.30 | $223.65 | -4.21% | 3 | |
| 2021-04-14 | 2021-04-30 | $244.08 | $236.48 | -9.14% | 13 | |
| 2019-11-22 | 2019-12-17 | $22.20 | $25.27 | 5.89% | 17 | |
| 2018-11-27 | 2018-12-20 | $22.93 | $21.03 | -3.12% | 17 | |
| 2018-03-13 | 2018-03-15 | $22.79 | $21.71 | -4.53% | 3 | |
| 2018-01-22 | 2018-02-09 | $23.44 | $20.69 | -8.08% | 15 | |
| 2017-12-12 | 2017-12-26 | $22.74 | $21.15 | -1.04% | 10 | |
| 2017-10-18 | 2017-10-23 | $23.98 | $22.47 | -2.55% | 4 | |
| 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-03-24 | 2017-03-28 | $17.54 | $18.50 | 4.67% | 3 | |
| 2017-03-20 | 2017-03-22 | $17.46 | $17.00 | -3.46% | 3 | |
| 2017-01-31 | 2017-02-03 | $16.80 | $16.76 | 0.14% | 4 | |
| 2016-12-28 | 2017-01-25 | $14.65 | $16.96 | 12.46% | 19 | |
| 2016-07-22 | 2016-08-29 | $14.82 | $14.35 | -0.31% | 27 | |
| 2016-06-08 | 2016-06-16 | $15.70 | $14.53 | -5.20% | 7 | |
| 2016-03-29 | 2016-05-04 | $15.34 | $14.84 | 0.65% | 27 | |
| 2016-03-21 | 2016-03-24 | $15.89 | $15.18 | -3.63% | 4 | |
| 2015-10-01 | 2015-10-02 | $15.99 | $16.50 | -2.90% | 2 | |
| 2015-09-21 | 2015-09-30 | $17.61 | $16.56 | -4.45% | 8 | |
| 2015-08-06 | 2015-08-07 | $16.41 | $16.17 | -7.26% | 2 | |
| 2015-04-28 | 2015-07-28 | $15.37 | $17.65 | 7.37% | 64 | |
| 2014-11-11 | 2014-12-02 | $16.74 | $15.43 | -3.50% | 15 | |
| 2014-10-08 | 2014-10-09 | $17.29 | $17.13 | -0.25% | 2 | |
| 2014-07-31 | 2014-09-23 | $14.89 | $16.69 | 7.35% | 38 | |
| 2014-06-06 | 2014-07-17 | $13.88 | $14.36 | 3.93% | 29 | |
| 2014-05-28 | 2014-06-04 | $14.02 | $13.60 | -2.66% | 6 | |
| 2014-01-13 | 2014-01-14 | $9.29 | $10.75 | -3.66% | 2 | |
| 2014-01-07 | 2014-01-08 | $9.96 | $10.09 | 1.12% | 2 | |
| 2013-03-26 | 2013-04-02 | $2.52 | $2.96 | 13.44% | 5 | |
| 2013-03-08 | 2013-03-18 | $2.56 | $2.34 | -6.31% | 7 | |
| 2013-02-15 | 2013-02-22 | $2.47 | $2.41 | -6.61% | 5 | |
| 2013-02-12 | 2013-02-14 | $2.53 | $2.55 | -0.10% | 3 | |
| 2013-01-23 | 2013-01-24 | $2.40 | $2.47 | 1.68% | 2 | |
| 2012-11-06 | 2013-01-14 | $2.08 | $2.22 | 3.52% | 47 | |
| 2012-09-18 | 2012-09-21 | $2.09 | $2.00 | -4.20% | 4 | |
| 2012-07-06 | 2012-07-24 | $2.07 | $1.99 | -1.50% | 13 | |
| 2012-06-27 | 2012-07-03 | $2.13 | $2.04 | -3.22% | 5 | |
| 2012-06-19 | 2012-06-25 | $2.14 | $2.21 | 4.76% | 5 | |
| 2012-02-15 | 2012-04-10 | $2.24 | $2.16 | 0.02% | 38 |