LongTermTrend_V1162
ARCHIVEDhybridllmTightened entry momentum filter (macd_hist > 0 instead of > -2.6) and added a volatility percentile cap on entries (vol_pctile < 0.75) to avoid extreme-volatility entrants. Broadened regime gates to only allow UPTREND/ SIDEWAYS, disallow HIGH volatility and non-normal bubble states. Improved exit logic to include price crossing below sma_20 and an absolute drawdown stop (drawdown > 12%) in addition to macd_hist < 0. Added volatility-based position scaling (reduce to 60% exposure when vol_pctile > 0.66) and lowered base position to 0.9 to reduce risk and drawdown.
Lineage
added entry filter: sma_20 < close; added entry filter: macd_hist > -2.6055
Strategy Logic (pseudocode)
# LongTermTrend_V1162 [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.0024) or ret_20d > 0.085) and ret_20d > 0.05 and cumret_252d > -0.1997 and dist_sma_50 > -0.0774) or ((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)))) and sma_20 < close and macd_hist > 0.0 and vol_pctile < 0.75):
position = 0.9
if long and (macd_hist < 0.0 or close < sma_20 or drawdown > 0.12):
position = 0.0 # exit to cashBacktest Metrics
| Metric | Train | Validation | Hidden Test | Full |
|---|---|---|---|---|
| CAGR | -0.1% | 6.8% | 8.9% | 3.5% |
| Total Return | -0.7% | 21.8% | 37.5% | 66.3% |
| Sharpe | 0.07 | 0.44 | 0.53 | 0.28 |
| Sortino | 0.04 | 0.28 | 0.37 | 0.18 |
| Calmar | -0.00 | 0.37 | 0.46 | 0.09 |
| Volatility | 15.8% | 18.6% | 19.5% | 17.4% |
| Max DD | -37.5% | -18.5% | -19.4% | -37.5% |
| Win Rate | 41.3% | 28.6% | 37.5% | 38.1% |
| Avg Win | 5.7% | 12.5% | 9.2% | 7.5% |
| Avg Loss | -3.7% | -2.6% | -2.9% | -3.3% |
| Payoff | 1.52 | 4.78 | 3.18 | 2.29 |
| Expectancy | 0.1% | 1.7% | 1.6% | 0.8% |
| Profit Factor | 1.07 | 1.91 | 1.91 | 1.41 |
| Trades | 46 | 14 | 24 | 84 |
| Avg Holding Days | 7.5 | 9.6 | 8.3 | 8.1 |
| Turnover | 10.4 | 8.4 | 11.6 | 10.3 |
| Exposure | 13.4% | 14.4% | 16.6% | 14.4% |
Growth of $100
Walk-Forward Years
| Year | CAGR | Sharpe | Max DD | Trades |
|---|---|---|---|---|
| 2016 | -3.4% | -0.24 | -9.4% | 5 |
| 2017 | 9.6% | 0.95 | -5.5% | 7 |
| 2018 | -6.3% | -0.68 | -10.8% | 3 |
| 2019 | -4.1% | -0.06 | -21.9% | 5 |
| 2020 | 0.0% | 0.00 | 0.0% | 0 |
| 2021 | 7.9% | 0.43 | -17.9% | 9 |
| 2022 | 0.7% | 0.12 | -18.5% | 4 |
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 | -3.2% | -1.37 | 1% |
| hidden test | EXPENSIVE | 83 | 38.5% | 2.44 | 2% |
| hidden test | EXTREME | 48 | 0.0% | 0.00 | 0% |
| hidden test | HIGH VOLATILITY | 254 | -9.6% | -0.62 | 2% |
| hidden test | LOW VOLATILITY | 438 | 19.1% | 0.97 | 25% |
| hidden test | MEDIUM VOLATILITY | 250 | 15.5% | 0.68 | 18% |
| hidden test | NORMAL | 811 | 8.2% | 0.40 | 19% |
| hidden test | SIDEWAYS | 293 | -14.9% | -0.62 | 31% |
| hidden test | UPTREND | 371 | 40.6% | 1.80 | 17% |
| train | DOWNTREND | 518 | -7.3% | -1.21 | 1% |
| train | EXPENSIVE | 311 | 11.6% | 1.83 | 2% |
| train | EXTREME | 100 | 0.0% | 0.00 | 0% |
| train | HIGH VOLATILITY | 699 | 6.4% | 0.42 | 1% |
| train | LOW VOLATILITY | 745 | 14.8% | 1.02 | 25% |
| train | MEDIUM VOLATILITY | 568 | -23.2% | -1.30 | 14% |
| train | NORMAL | 1,601 | -0.8% | -0.05 | 16% |
| train | SIDEWAYS | 592 | -9.0% | -0.49 | 21% |
| train | UPTREND | 902 | 12.7% | 0.71 | 16% |
| 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 | 1.2% | 0.07 | 1% |
| validation | LOW VOLATILITY | 183 | 4.1% | 0.24 | 34% |
| validation | MEDIUM VOLATILITY | 315 | 16.5% | 0.78 | 14% |
| validation | NORMAL | 474 | 13.2% | 0.56 | 23% |
| validation | SIDEWAYS | 206 | 1.6% | 0.08 | 22% |
| validation | UPTREND | 425 | 13.9% | 0.69 | 15% |
Trades (full period)
| Entry | Exit | Entry Px | Exit Px | Return | Days | |
|---|---|---|---|---|---|---|
| 2026-07-01 | 2026-07-06 | $425.30 | $419.77 | -5.97% | 3 | |
| 2026-05-28 | 2026-06-02 | $442.10 | $423.74 | -5.18% | 4 | |
| 2026-05-08 | 2026-05-21 | $428.35 | $417.85 | 1.06% | 10 | |
| 2026-04-20 | 2026-04-21 | $392.50 | $386.42 | -2.00% | 2 | |
| 2025-12-04 | 2025-12-30 | $454.53 | $454.43 | 2.46% | 18 | |
| 2025-09-08 | 2025-09-15 | $346.40 | $410.04 | 11.34% | 6 | |
| 2025-08-25 | 2025-09-03 | $346.60 | $334.09 | -2.99% | 7 | |
| 2025-08-11 | 2025-08-21 | $339.03 | $320.11 | -1.74% | 9 | |
| 2025-07-29 | 2025-08-01 | $321.20 | $302.63 | -4.97% | 4 | |
| 2025-07-21 | 2025-07-25 | $328.49 | $316.06 | -6.81% | 5 | |
| 2025-06-02 | 2025-06-03 | $342.69 | $344.27 | -1.16% | 2 | |
| 2025-05-22 | 2025-05-28 | $341.04 | $356.90 | 7.40% | 4 | |
| 2025-05-12 | 2025-05-13 | $318.38 | $334.07 | 5.89% | 2 | |
| 2024-09-23 | 2024-10-04 | $250.00 | $250.08 | 0.76% | 10 | |
| 2024-09-16 | 2024-09-20 | $226.78 | $238.25 | 5.15% | 5 | |
| 2024-09-04 | 2024-09-09 | $219.41 | $216.27 | -0.07% | 4 | |
| 2024-06-17 | 2024-07-12 | $187.44 | $248.23 | 31.32% | 18 | |
| 2023-12-15 | 2024-01-02 | $253.50 | $248.42 | -1.08% | 11 | |
| 2023-11-16 | 2023-12-13 | $233.59 | $239.29 | -2.31% | 19 | |
| 2023-10-06 | 2023-10-16 | $260.53 | $253.92 | -3.26% | 7 | |
| 2023-08-30 | 2023-09-22 | $256.90 | $244.88 | -0.62% | 17 | |
| 2023-07-06 | 2023-07-07 | $276.54 | $274.43 | -2.07% | 2 | |
| 2023-05-31 | 2023-06-27 | $203.93 | $250.21 | 17.57% | 19 | |
| 2023-03-24 | 2023-04-06 | $190.41 | $185.06 | -3.27% | 10 | |
| 2022-09-13 | 2022-09-23 | $292.13 | $275.33 | -4.84% | 9 | |
| 2022-08-16 | 2022-08-19 | $306.56 | $296.67 | -2.06% | 4 | |
| 2022-08-02 | 2022-08-12 | $300.59 | $300.03 | -3.37% | 9 | |
| 2022-03-21 | 2022-04-11 | $307.05 | $325.31 | 11.77% | 16 | |
| 2021-12-28 | 2022-01-04 | $362.82 | $383.20 | 8.55% | 6 | |
| 2021-10-13 | 2021-11-10 | $270.36 | $355.98 | 24.07% | 21 | |
| 2021-10-08 | 2021-10-11 | $261.83 | $263.98 | -1.10% | 2 | |
| 2021-09-28 | 2021-10-07 | $259.19 | $264.54 | -1.16% | 8 | |
| 2021-08-31 | 2021-09-21 | $245.24 | $246.46 | -0.26% | 15 | |
| 2021-08-02 | 2021-08-17 | $236.56 | $221.90 | -0.29% | 12 | |
| 2021-07-13 | 2021-07-15 | $222.85 | $216.87 | -4.42% | 3 | |
| 2021-06-18 | 2021-07-12 | $207.77 | $228.57 | 5.71% | 16 | |
| 2021-06-14 | 2021-06-16 | $205.90 | $201.62 | -1.73% | 3 | |
| 2021-04-14 | 2021-04-28 | $244.08 | $231.47 | -6.96% | 11 | |
| 2019-12-16 | 2019-12-17 | $25.43 | $25.27 | 5.62% | 2 | |
| 2019-10-15 | 2019-10-25 | $17.19 | $21.88 | 14.77% | 9 | |
| 2019-09-11 | 2019-09-25 | $16.47 | $15.25 | -4.85% | 11 | |
| 2019-07-22 | 2019-07-26 | $17.05 | $15.20 | -10.36% | 5 | |
| 2019-03-01 | 2019-03-04 | $19.65 | $19.02 | -7.23% | 2 | |
| 2018-12-11 | 2018-12-18 | $24.45 | $22.47 | -4.29% | 6 | |
| 2018-03-14 | 2018-03-15 | $21.78 | $21.71 | -4.18% | 2 | |
| 2018-01-11 | 2018-02-05 | $22.53 | $22.21 | 2.24% | 17 | |
| 2017-12-12 | 2017-12-26 | $22.74 | $21.15 | -1.18% | 10 | |
| 2017-10-18 | 2017-10-23 | $23.98 | $22.47 | -2.87% | 4 | |
| 2017-10-13 | 2017-10-17 | $23.70 | $23.72 | -1.46% | 3 | |
| 2017-03-24 | 2017-03-28 | $17.54 | $18.50 | 5.26% | 3 | |
| 2017-03-20 | 2017-03-22 | $17.46 | $17.00 | -3.90% | 3 | |
| 2017-01-31 | 2017-02-02 | $16.80 | $16.77 | -0.68% | 3 | |
| 2016-12-28 | 2017-01-25 | $14.65 | $16.96 | 14.10% | 19 | |
| 2016-07-22 | 2016-08-09 | $14.82 | $15.27 | 2.14% | 13 | |
| 2016-06-08 | 2016-06-13 | $15.70 | $14.52 | -5.42% | 4 | |
| 2016-04-04 | 2016-04-14 | $16.47 | $16.79 | 6.24% | 9 | |
| 2016-03-28 | 2016-04-01 | $15.35 | $15.84 | 0.62% | 5 | |
| 2016-03-21 | 2016-03-24 | $15.89 | $15.18 | -4.09% | 4 | |
| 2015-12-29 | 2016-01-05 | $15.81 | $14.90 | -2.32% | 5 | |
| 2015-09-21 | 2015-09-29 | $17.61 | $16.44 | -4.38% | 7 | |
| 2015-07-21 | 2015-07-22 | $17.78 | $17.86 | -5.11% | 2 | |
| 2015-06-22 | 2015-07-09 | $17.32 | $17.19 | -2.73% | 13 | |
| 2015-04-28 | 2015-05-22 | $15.37 | $16.52 | 5.28% | 19 | |
| 2015-04-14 | 2015-04-21 | $13.83 | $13.96 | -2.11% | 6 | |
| 2014-11-25 | 2014-12-01 | $16.54 | $15.44 | -0.98% | 4 | |
| 2014-11-11 | 2014-11-24 | $16.74 | $16.45 | 0.16% | 10 | |
| 2014-10-08 | 2014-10-13 | $17.29 | $14.97 | -8.03% | 4 | |
| 2014-09-02 | 2014-09-12 | $18.94 | $18.61 | 3.37% | 9 | |
| 2014-07-31 | 2014-08-25 | $14.89 | $17.50 | 10.73% | 18 | |
| 2014-05-28 | 2014-07-07 | $14.02 | $14.84 | 7.37% | 28 | |
| 2014-01-07 | 2014-01-08 | $9.96 | $10.09 | 1.26% | 2 | |
| 2013-03-27 | 2013-04-02 | $2.54 | $2.96 | 14.22% | 4 | |
| 2013-03-08 | 2013-03-15 | $2.56 | $2.35 | -3.41% | 6 | |
| 2013-02-12 | 2013-02-14 | $2.53 | $2.55 | -0.11% | 3 | |
| 2013-01-23 | 2013-01-24 | $2.40 | $2.47 | 1.89% | 2 | |
| 2012-11-06 | 2012-12-14 | $2.08 | $2.25 | 5.87% | 28 | |
| 2012-09-18 | 2012-09-21 | $2.09 | $2.00 | -4.72% | 4 | |
| 2012-07-20 | 2012-07-23 | $2.12 | $2.04 | -1.52% | 2 | |
| 2012-07-13 | 2012-07-19 | $2.28 | $2.15 | -1.64% | 5 | |
| 2012-06-27 | 2012-07-03 | $2.13 | $2.04 | -3.62% | 5 | |
| 2012-06-19 | 2012-06-25 | $2.14 | $2.21 | 5.34% | 5 | |
| 2012-03-28 | 2012-04-05 | $2.52 | $2.30 | -7.13% | 7 | |
| 2012-03-14 | 2012-03-16 | $2.35 | $2.35 | -2.90% | 3 | |
| 2012-02-15 | 2012-02-29 | $2.24 | $2.23 | 1.56% | 10 |