LongTermTrend_V0371
ARCHIVEDhybridllmRemoved redundant ret_20d check and added momentum confirmation (ret_60d + macd_hist) and RSI cap to reduce overbought entries. Added regime gates to avoid trading in strong downtrends, high-volatility-only regimes, and bubble states (trade only UPTREND/SIDEWAYS, LOW/MEDIUM vol, NORMAL bubble). Improved exits: keep the 20d loss stop, add close < sma_50 and extreme RSI >80 as timely exit signals. Lowered base position to 0.6 and added volatility-based sizing (full size in low vol, reduced in high vol) plus a hard stop-to-zero when portfolio drawdown is severe. These changes aim to reduce overfitting and risk while keeping trend capture.
Lineage
Parents (1)
changed ret_20d threshold 0.05 -> 0.1208
Strategy Logic (pseudocode)
# LongTermTrend_V0371 [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.0022) or ret_5d > 0.0029) and ret_20d > 0.03 and ret_60d > 0.02 and macd_hist > 0.0 and rsi_14 < 75.0):
position = 0.6
if long and (ret_20d < -0.03 or close < sma_50 or rsi_14 > 80.0):
position = 0.0 # exit to cashBacktest Metrics
| Metric | Train | Validation | Hidden Test | Full |
|---|
| CAGR | 0.5% | -6.1% | -2.6% | -1.7% |
| Total Return | 3.8% | -17.2% | -9.3% | -22.1% |
| Sharpe | 0.10 | -0.56 | -0.15 | -0.11 |
| Sortino | 0.05 | -0.25 | -0.08 | -0.05 |
| Calmar | 0.02 | -0.24 | -0.14 | -0.04 |
| Volatility | 9.9% | 10.4% | 12.5% | 10.7% |
| Max DD | -24.1% | -25.9% | -19.2% | -38.3% |
| Win Rate | 31.6% | 16.7% | 40.0% | 32.5% |
| Avg Win | 8.3% | 13.1% | 6.0% | 7.6% |
| Avg Loss | -3.3% | -6.0% | -4.8% | -4.3% |
| Payoff | 2.51 | 2.19 | 1.26 | 1.78 |
| Expectancy | 0.4% | -2.8% | -0.5% | -0.4% |
| Profit Factor | 1.16 | 0.44 | 0.84 | 0.86 |
| Trades | 19 | 6 | 15 | 40 |
| Avg Holding Days | 16.3 | 20.7 | 10.3 | 14.7 |
| Turnover | 2.9 | 2.4 | 4.9 | 3.3 |
| Exposure | 8.7% | 9.4% | 9.0% | 8.9% |
Growth of $100
LongTermTrend_V0371 vs TSLA Buy & Hold
LongTermTrend_V0371 TSLA Buy & HoldIn-sampleValidationHidden test
Growth of $100 · log scale · in-sample, validation and hidden-test segments are shaded separately and must not be compared as one out-of-sample track record.
Walk-Forward Years
year-by-year stability matters more than any single year
| Year | CAGR | Sharpe | Max DD | Trades |
|---|
| 2016 | -5.3% | -0.73 | -11.4% | 3 |
| 2017 | 8.6% | 2.05 | -0.5% | 1 |
| 2018 | -10.6% | -1.38 | -11.1% | 2 |
| 2019 | -3.2% | -0.15 | -14.4% | 3 |
| 2020 | 0.0% | 0.00 | 0.0% | 0 |
| 2021 | 3.5% | 0.35 | -7.6% | 3 |
| 2022 | -20.1% | -1.60 | -22.3% | 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 | 267 | 0.0% | 0.00 | 0% |
| hidden test | EXPENSIVE | 83 | 25.7% | 2.44 | 1% |
| hidden test | EXTREME | 48 | 0.0% | 0.00 | 0% |
| hidden test | HIGH VOLATILITY | 254 | -9.3% | -0.85 | 1% |
| hidden test | LOW VOLATILITY | 429 | 7.0% | 0.61 | 13% |
| hidden test | MEDIUM VOLATILITY | 248 | -9.6% | -0.63 | 10% |
| hidden test | NORMAL | 800 | -4.8% | -0.37 | 10% |
| hidden test | SIDEWAYS | 293 | -21.8% | -1.68 | 12% |
| hidden test | UPTREND | 371 | 12.6% | 0.79 | 13% |
| train | DOWNTREND | 518 | -0.2% | -0.79 | 0% |
| train | EXPENSIVE | 311 | 0.7% | 0.84 | 0% |
| train | EXTREME | 100 | 0.0% | 0.00 | 0% |
| train | HIGH VOLATILITY | 699 | 2.4% | 0.23 | 0% |
| train | LOW VOLATILITY | 745 | 9.7% | 0.93 | 19% |
| train | MEDIUM VOLATILITY | 568 | -12.2% | -1.42 | 5% |
| train | NORMAL | 1,601 | 1.1% | 0.10 | 11% |
| train | SIDEWAYS | 592 | -10.1% | -1.10 | 6% |
| train | UPTREND | 902 | 8.9% | 0.70 | 15% |
| 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 | 1.9% | 0.15 | 28% |
| validation | MEDIUM VOLATILITY | 315 | -9.1% | -0.80 | 6% |
| validation | NORMAL | 474 | -9.2% | -0.70 | 15% |
| validation | SIDEWAYS | 206 | -20.5% | -1.57 | 13% |
| validation | UPTREND | 425 | -0.3% | -0.03 | 11% |
Trades (full period)
40 trades
| Entry | Exit | Entry Px | Exit Px | Return | Days | |
|---|
| 2026-05-12 | 2026-06-08 | $433.45 | $408.95 | -7.42% | 19 | |
| 2025-12-12 | 2026-01-05 | $458.96 | $451.67 | -1.20% | 15 | |
| 2025-08-28 | 2025-09-15 | $345.98 | $410.04 | 7.78% | 12 | |
| 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-23 | 2024-10-14 | $250.00 | $219.16 | -5.15% | 16 | |
| 2024-09-16 | 2024-09-20 | $226.78 | $238.25 | 3.45% | 5 | |
| 2024-09-05 | 2024-09-09 | $230.17 | $216.27 | -2.39% | 3 | |
| 2024-09-03 | 2024-09-04 | $210.60 | $219.41 | -1.10% | 2 | |
| 2024-06-18 | 2024-07-03 | $184.86 | $246.39 | 13.52% | 11 | |
| 2023-12-19 | 2024-01-10 | $257.22 | $233.94 | -4.16% | 15 | |
| 2023-09-12 | 2023-09-22 | $267.48 | $244.88 | -4.05% | 9 | |
| 2023-06-22 | 2023-08-02 | $264.61 | $254.11 | 0.62% | 29 | |
| 2023-06-01 | 2023-06-08 | $207.52 | $234.86 | 5.85% | 6 | |
| 2023-04-03 | 2023-04-06 | $194.77 | $185.06 | -6.54% | 4 | |
| 2022-09-20 | 2022-09-26 | $308.73 | $276.01 | -6.76% | 5 | |
| 2022-08-03 | 2022-08-29 | $307.40 | $284.82 | -2.47% | 19 | |
| 2022-03-29 | 2022-04-27 | $366.52 | $293.84 | -12.09% | 21 | |
| 2021-11-09 | 2021-11-10 | $341.17 | $355.98 | -7.31% | 2 | |
| 2021-08-03 | 2021-10-19 | $236.58 | $288.09 | 13.10% | 55 | |
| 2021-06-24 | 2021-07-26 | $226.61 | $219.21 | -1.24% | 22 | |
| 2019-10-21 | 2019-10-25 | $16.90 | $21.88 | 9.89% | 5 | |
| 2019-09-12 | 2019-09-25 | $16.39 | $15.25 | -5.95% | 10 | |
| 2019-07-23 | 2019-07-26 | $17.34 | $15.20 | -6.30% | 4 | |
| 2018-12-11 | 2018-12-19 | $24.45 | $22.20 | -4.75% | 7 | |
| 2018-01-22 | 2018-02-09 | $23.44 | $20.69 | -6.05% | 15 | |
| 2017-01-03 | 2017-01-24 | $14.47 | $16.97 | 9.52% | 15 | |
| 2016-08-01 | 2016-08-23 | $15.33 | $14.99 | -3.16% | 17 | |
| 2016-06-08 | 2016-06-10 | $15.70 | $14.59 | -0.88% | 3 | |
| 2016-04-04 | 2016-05-04 | $16.47 | $14.84 | -1.32% | 23 | |
| 2015-04-29 | 2015-07-28 | $15.50 | $17.65 | 5.91% | 63 | |
| 2015-04-14 | 2015-04-21 | $13.83 | $13.96 | -1.41% | 6 | |
| 2014-09-08 | 2014-09-16 | $18.81 | $17.38 | -5.18% | 7 | |
| 2014-08-05 | 2014-09-03 | $15.90 | $18.75 | 11.05% | 21 | |
| 2014-06-19 | 2014-07-17 | $15.19 | $14.36 | -2.67% | 20 | |
| 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-06 | 2013-01-11 | $2.08 | $2.19 | 3.88% | 46 | |
| 2012-07-16 | 2012-07-20 | $2.40 | $2.12 | -3.51% | 5 | |
| 2012-02-17 | 2012-04-10 | $2.33 | $2.16 | -1.61% | 36 | |