LongTermTrend_V1526
ARCHIVEDhybridllmAdded regime gates to restrict to UPTREND and non-high volatility; relaxed and generalized entry filters (lowered ret_20d and cumret thresholds, added breakout+volume OR SMA200 trend combo, RSI and vol_pctile filters) to reduce overfitting; improved exit to use SMA50 cross and a larger short-rate stop (ret_20d<-3%); introduced position scaling (higher size on breakouts/strong recent returns) and reduced base position to 0.6 to lower risk/turnover.
Lineage
removed entry condition: ((macd_hist > 0.0 and close > sma_50) or ((breakout_50 == 1 and rel_volume > 1.5045) or ((macd_hist > 0.0 and close > sma_50) and sma_50 > sma_200)))
Strategy Logic (pseudocode)
# LongTermTrend_V1526 [hybrid]
require regime.trend in ['UPTREND']
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) or (breakout_20 > 0.5 and rel_volume > 1.2)) and ret_20d > 0.02 and cumret_252d > 0.02 and rsi_14 < 70.0 and vol_pctile < 0.9):
position = 0.6
if long and (close < sma_50 or ret_20d < -0.03):
position = 0.0 # exit to cashBacktest Metrics
| Metric | Train | Validation | Hidden Test | Full |
|---|---|---|---|---|
| CAGR | -1.6% | -1.2% | -1.9% | -1.6% |
| Total Return | -12.1% | -3.5% | -6.9% | -21.0% |
| Sharpe | -0.14 | -0.05 | -0.18 | -0.13 |
| Sortino | -0.07 | -0.02 | -0.06 | -0.05 |
| Calmar | -0.06 | -0.04 | -0.12 | -0.04 |
| Volatility | 8.6% | 11.2% | 8.4% | 9.2% |
| Max DD | -25.2% | -29.2% | -16.0% | -35.5% |
| Win Rate | 38.1% | 22.2% | 50.0% | 37.5% |
| Avg Win | 3.8% | 13.9% | 2.3% | 4.6% |
| Avg Loss | -3.2% | -3.9% | -3.5% | -3.5% |
| Payoff | 1.19 | 3.54 | 0.65 | 1.34 |
| Expectancy | -0.5% | 0.0% | -0.6% | -0.4% |
| Profit Factor | 0.73 | 1.01 | 0.65 | 0.80 |
| Trades | 21 | 9 | 10 | 40 |
| Avg Holding Days | 11.5 | 11.8 | 7.3 | 10.5 |
| Turnover | 3.2 | 3.6 | 3.2 | 3.3 |
| Exposure | 6.6% | 7.7% | 4.0% | 6.1% |
Growth of $100
Walk-Forward Years
| Year | CAGR | Sharpe | Max DD | Trades |
|---|---|---|---|---|
| 2016 | -4.4% | -1.02 | -5.3% | 1 |
| 2017 | 1.5% | 0.96 | -0.1% | 1 |
| 2018 | -10.3% | -1.37 | -10.3% | 3 |
| 2019 | 7.8% | 1.54 | -1.4% | 1 |
| 2020 | 0.0% | 0.00 | 0.0% | 0 |
| 2021 | 16.9% | 1.05 | -14.3% | 4 |
| 2022 | -17.5% | -1.70 | -19.3% | 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 | 278 | 0.0% | 0.00 | 0% |
| hidden test | EXPENSIVE | 83 | 25.5% | 2.44 | 1% |
| hidden test | EXTREME | 48 | 0.0% | 0.00 | 0% |
| hidden test | HIGH VOLATILITY | 254 | -8.5% | -1.00 | 0% |
| hidden test | LOW VOLATILITY | 443 | 0.2% | 0.03 | 6% |
| hidden test | MEDIUM VOLATILITY | 250 | 2.5% | 0.26 | 4% |
| hidden test | NORMAL | 816 | -4.4% | -0.52 | 4% |
| hidden test | SIDEWAYS | 298 | -8.1% | -1.02 | 1% |
| hidden test | UPTREND | 371 | 2.6% | 0.23 | 10% |
| train | DOWNTREND | 518 | 0.0% | 0.00 | 0% |
| train | EXPENSIVE | 311 | 6.0% | 1.51 | 1% |
| train | EXTREME | 100 | 0.0% | 0.00 | 0% |
| train | HIGH VOLATILITY | 699 | -0.5% | -0.06 | 0% |
| train | LOW VOLATILITY | 745 | 7.6% | 0.76 | 14% |
| train | MEDIUM VOLATILITY | 568 | -13.8% | -1.70 | 5% |
| train | NORMAL | 1,601 | -2.7% | -0.29 | 8% |
| train | SIDEWAYS | 592 | -4.3% | -1.06 | 0% |
| train | UPTREND | 902 | 0.1% | 0.01 | 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 | -4.9% | -0.66 | 0% |
| validation | LOW VOLATILITY | 183 | 7.7% | 0.75 | 20% |
| validation | MEDIUM VOLATILITY | 315 | -1.8% | -0.13 | 6% |
| validation | NORMAL | 474 | -0.9% | -0.06 | 12% |
| validation | SIDEWAYS | 206 | -15.9% | -1.76 | 1% |
| validation | UPTREND | 425 | 6.7% | 0.49 | 13% |
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-08 | 2026-01-05 | $439.58 | $451.67 | -2.24% | 19 | |
| 2025-09-12 | 2025-09-15 | $395.94 | $410.04 | 4.29% | 2 | |
| 2025-09-04 | 2025-09-05 | $338.53 | $350.84 | 0.68% | 2 | |
| 2025-07-21 | 2025-07-23 | $328.49 | $332.56 | 0.33% | 3 | |
| 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-09-25 | 2024-09-27 | $257.02 | $260.46 | -0.13% | 3 | |
| 2024-01-03 | 2024-01-10 | $238.45 | $233.94 | -3.38% | 6 | |
| 2023-06-26 | 2023-08-02 | $241.05 | $254.11 | 1.27% | 27 | |
| 2022-09-20 | 2022-09-23 | $308.73 | $275.33 | -4.12% | 4 | |
| 2022-09-12 | 2022-09-14 | $304.42 | $302.61 | -1.61% | 3 | |
| 2022-08-16 | 2022-08-22 | $306.56 | $289.91 | -2.59% | 5 | |
| 2022-04-06 | 2022-04-27 | $348.59 | $293.84 | -12.12% | 15 | |
| 2022-01-12 | 2022-01-13 | $368.74 | $343.85 | 2.24% | 2 | |
| 2021-12-09 | 2021-12-10 | $334.60 | $339.01 | -3.78% | 2 | |
| 2021-11-23 | 2021-12-01 | $369.68 | $365.00 | -0.69% | 6 | |
| 2021-08-24 | 2021-11-10 | $236.16 | $355.98 | 25.61% | 56 | |
| 2021-08-05 | 2021-08-23 | $238.21 | $235.43 | -2.66% | 13 | |
| 2019-11-26 | 2019-12-17 | $21.93 | $25.27 | 7.81% | 15 | |
| 2018-11-27 | 2018-12-19 | $22.93 | $22.20 | -1.59% | 16 | |
| 2018-02-08 | 2018-02-09 | $21.02 | $20.69 | -5.29% | 2 | |
| 2018-02-01 | 2018-02-06 | $23.28 | $22.26 | -3.73% | 4 | |
| 2017-03-27 | 2017-03-28 | $18.01 | $18.50 | 1.49% | 2 | |
| 2016-04-11 | 2016-05-04 | $16.66 | $14.84 | -4.38% | 18 | |
| 2015-08-06 | 2015-08-07 | $16.41 | $16.17 | -5.45% | 2 | |
| 2015-05-21 | 2015-07-28 | $16.37 | $17.65 | 2.22% | 47 | |
| 2014-09-19 | 2014-09-23 | $17.29 | $16.69 | -3.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 | |
| 2014-05-06 | 2014-05-07 | $13.82 | $13.42 | -2.70% | 2 | |
| 2013-03-26 | 2013-04-02 | $2.52 | $2.96 | 10.06% | 5 | |
| 2013-03-22 | 2013-03-25 | $2.44 | $2.50 | 0.90% | 2 | |
| 2013-03-14 | 2013-03-15 | $2.46 | $2.35 | -3.40% | 2 | |
| 2013-02-15 | 2013-02-22 | $2.47 | $2.41 | -4.92% | 5 | |
| 2013-02-12 | 2013-02-14 | $2.53 | $2.55 | -0.07% | 3 | |
| 2013-01-23 | 2013-01-24 | $2.40 | $2.47 | 1.26% | 2 | |
| 2012-12-18 | 2013-01-11 | $2.31 | $2.19 | -1.60% | 17 | |
| 2012-11-28 | 2012-12-14 | $2.22 | $2.25 | 2.64% | 13 | |
| 2012-02-23 | 2012-04-10 | $2.30 | $2.16 | -1.69% | 33 |