LongTermTrend_V1706
ARCHIVEDhybridllmRelaxed entry threshold and added multi-factor entry (momentum + trend slope + not overbought + breakout/volume) to increase robustness; added explicit trend and volatility regime gates to avoid downtrend/high-volatility periods; widened bubble gate to include NORMAL and EXPENSIVE to avoid zero-trade validation issues; improved exits with layered stop rules (20d loss, drawdown limit, MACD weakness, extreme RSI) to cut losses earlier; added volatility-based position scaling (reduce size in medium/high vol) to control drawdowns.
Lineage
removed entry condition: (((close > sma_200 and sma_200_slope > -0.0012) or ret_20d > 0.0257) and ret_20d > 0.05 and cumret_252d > -0.1997)
Strategy Logic (pseudocode)
# LongTermTrend_V1706 [hybrid]
require regime.trend in ['UPTREND']
require regime.volatility in ['LOW_VOLATILITY', 'MEDIUM_VOLATILITY']
require regime.bubble in ['NORMAL', 'EXPENSIVE']
if flat and (ret_20d > 0.03 and sma_50_slope > 0.0 and rsi_14 < 75.0 and (breakout_20 > 0.0 or volume_breakout > 0.0)):
position = 1.0
if long and (ret_20d < -0.08 or drawdown < -0.12 or (macd_hist < 0.0 and macd < 0.0) or rsi_14 > 85.0):
position = 0.0 # exit to cashBacktest Metrics
| Metric | Train | Validation | Hidden Test | Full |
|---|---|---|---|---|
| CAGR | 1.2% | 9.8% | -4.9% | 1.3% |
| Total Return | 10.3% | 32.4% | -17.4% | 20.7% |
| Sharpe | 0.16 | 0.60 | -0.32 | 0.16 |
| Sortino | 0.08 | 0.34 | -0.12 | 0.08 |
| Calmar | 0.05 | 0.37 | -0.18 | 0.04 |
| Volatility | 15.3% | 18.3% | 13.1% | 15.4% |
| Max DD | -23.1% | -26.2% | -28.2% | -33.5% |
| Win Rate | 45.8% | 23.5% | 45.5% | 38.5% |
| Avg Win | 7.0% | 23.7% | 4.3% | 9.7% |
| Avg Loss | -4.6% | -3.9% | -6.4% | -4.7% |
| Payoff | 1.52 | 6.02 | 0.68 | 2.07 |
| Expectancy | 0.7% | 2.6% | -1.5% | 0.8% |
| Profit Factor | 1.29 | 1.85 | 0.57 | 1.30 |
| Trades | 24 | 17 | 11 | 52 |
| Avg Holding Days | 10.0 | 5.5 | 5.1 | 7.5 |
| Turnover | 6.0 | 11.3 | 5.8 | 7.0 |
| Exposure | 10.7% | 10.1% | 4.7% | 9.1% |
Growth of $100
Walk-Forward Years
| Year | CAGR | Sharpe | Max DD | Trades |
|---|---|---|---|---|
| 2016 | 2.2% | 0.36 | -6.3% | 3 |
| 2017 | 11.2% | 0.76 | -11.9% | 6 |
| 2018 | -12.0% | -1.48 | -12.0% | 2 |
| 2019 | 19.6% | 2.07 | -0.7% | 1 |
| 2020 | 31.7% | 1.61 | -7.9% | 2 |
| 2021 | 15.9% | 0.73 | -26.2% | 11 |
| 2022 | -16.4% | -1.87 | -16.3% | 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 | 279 | 0.0% | 0.00 | 0% |
| hidden test | EXPENSIVE | 83 | -16.3% | -0.54 | 25% |
| hidden test | EXTREME | 48 | 0.0% | 0.00 | 0% |
| hidden test | HIGH VOLATILITY | 254 | -8.6% | -1.01 | 0% |
| hidden test | LOW VOLATILITY | 445 | 6.3% | 0.61 | 5% |
| hidden test | MEDIUM VOLATILITY | 251 | -18.4% | -0.94 | 9% |
| hidden test | NORMAL | 819 | -3.2% | -0.31 | 3% |
| hidden test | SIDEWAYS | 300 | 0.0% | 0.00 | 0% |
| hidden test | UPTREND | 371 | -10.8% | -0.52 | 12% |
| train | DOWNTREND | 518 | 0.0% | 0.00 | 0% |
| train | EXPENSIVE | 311 | 46.8% | 1.89 | 22% |
| train | EXTREME | 100 | 11.6% | 1.55 | 1% |
| train | HIGH VOLATILITY | 699 | 6.9% | 0.61 | 1% |
| train | LOW VOLATILITY | 745 | 11.3% | 0.70 | 19% |
| train | MEDIUM VOLATILITY | 568 | -14.9% | -0.82 | 13% |
| train | NORMAL | 1,601 | -6.8% | -0.52 | 9% |
| train | SIDEWAYS | 592 | -4.6% | -1.13 | 1% |
| train | UPTREND | 902 | 8.4% | 0.37 | 24% |
| validation | DOWNTREND | 125 | 0.0% | 0.00 | 0% |
| validation | EXPENSIVE | 138 | 50.7% | 1.69 | 31% |
| validation | EXTREME | 144 | 26.0% | 1.86 | 1% |
| validation | HIGH VOLATILITY | 258 | 0.0% | 0.00 | 0% |
| validation | LOW VOLATILITY | 183 | -5.8% | -0.47 | 17% |
| validation | MEDIUM VOLATILITY | 315 | 29.8% | 1.12 | 14% |
| validation | NORMAL | 474 | -5.1% | -0.35 | 7% |
| validation | SIDEWAYS | 206 | -8.4% | -1.12 | 0% |
| validation | UPTREND | 425 | 23.6% | 0.99 | 18% |
Trades (full period)
| Entry | Exit | Entry Px | Exit Px | Return | Days | |
|---|---|---|---|---|---|---|
| 2025-12-15 | 2026-01-08 | $475.31 | $435.80 | -6.19% | 17 | |
| 2025-10-29 | 2025-11-14 | $461.51 | $404.35 | -12.89% | 13 | |
| 2025-09-30 | 2025-10-13 | $444.72 | $435.90 | -6.89% | 10 | |
| 2025-09-12 | 2025-09-15 | $395.94 | $410.04 | 7.15% | 2 | |
| 2025-05-28 | 2025-05-29 | $356.90 | $358.43 | -1.85% | 2 | |
| 2024-09-16 | 2024-09-17 | $226.78 | $227.87 | -1.72% | 2 | |
| 2024-09-06 | 2024-09-09 | $210.73 | $216.27 | -8.64% | 2 | |
| 2024-07-02 | 2024-07-03 | $231.26 | $246.39 | 9.99% | 2 | |
| 2023-07-18 | 2023-07-19 | $293.34 | $291.26 | 0.82% | 2 | |
| 2023-07-05 | 2023-07-06 | $282.48 | $276.54 | 0.75% | 2 | |
| 2023-06-02 | 2023-06-05 | $213.97 | $217.61 | 2.91% | 2 | |
| 2022-09-20 | 2022-09-21 | $308.73 | $300.80 | -0.31% | 2 | |
| 2022-08-16 | 2022-08-17 | $306.56 | $304.00 | -1.09% | 2 | |
| 2022-08-05 | 2022-08-08 | $288.17 | $290.42 | -6.82% | 2 | |
| 2022-04-05 | 2022-04-07 | $363.75 | $352.42 | -8.89% | 3 | |
| 2021-10-08 | 2021-10-26 | $261.83 | $339.48 | 28.88% | 13 | |
| 2021-09-27 | 2021-10-01 | $263.79 | $258.41 | -0.06% | 5 | |
| 2021-09-20 | 2021-09-21 | $243.39 | $246.46 | -4.06% | 2 | |
| 2021-09-16 | 2021-09-17 | $252.33 | $253.16 | -0.05% | 2 | |
| 2021-09-10 | 2021-09-13 | $245.42 | $247.67 | -2.66% | 2 | |
| 2021-09-08 | 2021-09-09 | $251.29 | $251.62 | -0.07% | 2 | |
| 2021-09-01 | 2021-09-02 | $244.70 | $244.13 | -0.42% | 2 | |
| 2021-08-13 | 2021-08-16 | $239.06 | $228.72 | -0.90% | 2 | |
| 2021-08-05 | 2021-08-06 | $238.21 | $233.03 | 0.32% | 2 | |
| 2021-01-26 | 2021-02-23 | $294.36 | $232.95 | -19.04% | 20 | |
| 2020-12-18 | 2021-01-11 | $231.67 | $270.40 | 33.91% | 15 | |
| 2020-11-19 | 2020-12-08 | $166.42 | $216.63 | 31.62% | 13 | |
| 2020-10-15 | 2020-10-20 | $149.63 | $140.65 | -6.79% | 4 | |
| 2019-12-13 | 2019-12-27 | $23.89 | $28.69 | 19.57% | 10 | |
| 2018-12-04 | 2018-12-19 | $23.98 | $22.20 | -6.17% | 11 | |
| 2018-02-01 | 2018-02-06 | $23.28 | $22.26 | -6.17% | 4 | |
| 2017-09-18 | 2017-09-29 | $25.67 | $22.74 | -10.76% | 10 | |
| 2017-08-04 | 2017-08-07 | $23.79 | $23.68 | 2.63% | 2 | |
| 2017-06-06 | 2017-06-14 | $23.52 | $25.38 | 8.03% | 7 | |
| 2017-04-26 | 2017-05-10 | $20.68 | $21.68 | 2.17% | 11 | |
| 2017-03-28 | 2017-04-04 | $18.50 | $20.25 | 10.26% | 6 | |
| 2017-01-05 | 2017-01-06 | $15.12 | $15.27 | -0.31% | 2 | |
| 2016-07-29 | 2016-08-01 | $15.65 | $15.33 | 1.61% | 2 | |
| 2016-07-26 | 2016-07-27 | $15.30 | $15.23 | -0.42% | 2 | |
| 2016-04-05 | 2016-04-11 | $17.03 | $16.66 | 1.05% | 5 | |
| 2015-06-18 | 2015-08-07 | $17.46 | $16.17 | -5.67% | 36 | |
| 2015-06-09 | 2015-06-11 | $17.07 | $16.76 | -2.38% | 3 | |
| 2015-05-29 | 2015-06-01 | $16.72 | $16.63 | -0.46% | 2 | |
| 2015-05-12 | 2015-05-13 | $16.32 | $16.21 | 1.99% | 2 | |
| 2015-04-30 | 2015-05-01 | $15.07 | $15.07 | -2.95% | 2 | |
| 2014-08-05 | 2014-09-23 | $15.90 | $16.69 | 4.62% | 35 | |
| 2014-06-24 | 2014-07-08 | $15.50 | $14.60 | -6.33% | 10 | |
| 2014-02-14 | 2014-02-26 | $13.22 | $16.87 | 23.98% | 8 | |
| 2013-09-20 | 2013-10-10 | $12.23 | $11.53 | -5.32% | 15 | |
| 2013-01-24 | 2013-02-26 | $2.47 | $2.30 | -4.69% | 23 | |
| 2012-11-29 | 2012-12-14 | $2.25 | $2.25 | 0.94% | 12 | |
| 2012-03-13 | 2012-04-10 | $2.41 | $2.16 | -8.13% | 20 |