LongTermTrend_V1539
ARCHIVEDhybridllm1) Added trend and volatility regime gates to avoid DOWNTREND/HIGH_VOLATILITY and bubble states. 2) Strengthened entry: require either price above SMA200 with non-negative long-term slope or 20d momentum>6%, plus price>50SMA with positive 50SMA slope. 3) Added volatility and proximity-to-20SMA checks to reduce entries in extreme conditions. 4) Improved exits: multi-condition exit (short-term loss, break below SMA50, or drawdown limit) for better risk control. 5) Position scaling by vol_pctile: full size in low vol, reduced size in high vol, and lowered base position to 0.8 to temper turnover.
Lineage
Parents (1)
added entry filter: dist_sma_20 > -0.0187
Strategy Logic (pseudocode)
# LongTermTrend_V1539 [hybrid]
require regime.trend in ['UPTREND', 'SIDEWAYS']
require regime.volatility in ['LOW_VOLATILITY', 'MEDIUM_VOLATILITY']
require regime.bubble in ['EXPENSIVE', 'EXTREME']
if flat and (((close > sma_200 and sma_200_slope > -0.0005) or ret_20d > 0.06) and (close > sma_50 and sma_50_slope > 0.0) and dist_sma_20 > -0.05 and vol_pctile < 0.7):
position = 0.8
if long and (ret_20d < -0.08 or close < sma_50 or drawdown > 0.12):
position = 0.0 # exit to cashBacktest Metrics
| Metric | Train | Validation | Hidden Test | Full |
|---|
| CAGR | 0.7% | 40.1% | -0.1% | 7.6% |
| Total Return | 5.4% | 174.7% | -0.3% | 195.5% |
| Sharpe | 0.12 | 1.76 | 0.05 | 0.59 |
| Sortino | 0.05 | 1.58 | 0.02 | 0.29 |
| Calmar | 0.03 | 3.01 | -0.00 | 0.30 |
| Volatility | 12.5% | 20.3% | 10.6% | 14.1% |
| Max DD | -25.4% | -13.3% | -19.4% | -25.4% |
| Win Rate | 33.3% | 55.6% | 40.0% | 40.0% |
| Avg Win | 6.7% | 27.4% | 5.6% | 14.9% |
| Avg Loss | -3.2% | -3.8% | -3.6% | -3.4% |
| Payoff | 2.09 | 7.24 | 1.53 | 4.42 |
| Expectancy | 0.1% | 13.5% | 0.0% | 3.9% |
| Profit Factor | 1.04 | 9.05 | 1.02 | 2.95 |
| Trades | 21 | 9 | 5 | 35 |
| Avg Holding Days | 8.7 | 15.0 | 12.8 | 11.2 |
| Turnover | 4.3 | 4.8 | 2.1 | 3.8 |
| Exposure | 6.8% | 13.3% | 5.0% | 7.7% |
Growth of $100
LongTermTrend_V1539 vs TSLA Buy & Hold
LongTermTrend_V1539 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 | 0.0% | 0.00 | 0.0% | 0 |
| 2017 | -9.2% | -0.44 | -21.5% | 11 |
| 2018 | 0.0% | 0.00 | 0.0% | 0 |
| 2019 | 7.6% | 1.31 | -3.0% | 0 |
| 2020 | 150.2% | 3.11 | -13.3% | 8 |
| 2021 | 6.4% | 0.48 | -8.7% | 1 |
| 2022 | 0.0% | 0.00 | 0.0% | 0 |
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 | 22.5% | 0.78 | 44% |
| hidden test | EXTREME | 48 | 5.6% | 0.21 | 17% |
| hidden test | HIGH VOLATILITY | 254 | -2.8% | -1.02 | 0% |
| hidden test | LOW VOLATILITY | 443 | 14.9% | 2.09 | 3% |
| hidden test | MEDIUM VOLATILITY | 251 | -21.6% | -1.19 | 13% |
| hidden test | NORMAL | 817 | -2.1% | -0.98 | 0% |
| hidden test | SIDEWAYS | 298 | -1.3% | -0.71 | 1% |
| hidden test | UPTREND | 371 | 2.2% | 0.13 | 12% |
| train | DOWNTREND | 518 | 0.0% | 0.00 | 0% |
| train | EXPENSIVE | 311 | 0.7% | 0.02 | 34% |
| train | EXTREME | 100 | 55.3% | 2.34 | 25% |
| train | HIGH VOLATILITY | 699 | -6.2% | -0.45 | 1% |
| train | LOW VOLATILITY | 745 | 8.3% | 0.93 | 9% |
| train | MEDIUM VOLATILITY | 568 | 1.8% | 0.12 | 11% |
| train | NORMAL | 1,601 | -1.8% | -0.86 | 0% |
| train | SIDEWAYS | 592 | 0.0% | 0.00 | 0% |
| train | UPTREND | 902 | 3.2% | 0.17 | 15% |
| validation | DOWNTREND | 125 | 0.0% | 0.00 | 0% |
| validation | EXPENSIVE | 138 | 44.1% | 1.29 | 52% |
| validation | EXTREME | 144 | 147.3% | 4.70 | 20% |
| validation | HIGH VOLATILITY | 258 | 28.5% | 1.90 | 1% |
| validation | LOW VOLATILITY | 183 | -3.3% | -0.26 | 11% |
| validation | MEDIUM VOLATILITY | 315 | 64.3% | 2.43 | 24% |
| validation | NORMAL | 474 | -0.6% | -0.78 | 0% |
| validation | SIDEWAYS | 206 | 0.0% | 0.00 | 0% |
| validation | UPTREND | 425 | 63.5% | 2.36 | 24% |
Trades (full period)
35 trades
| Entry | Exit | Entry Px | Exit Px | Return | Days | |
|---|
| 2025-09-15 | 2025-11-13 | $410.04 | $401.99 | 7.14% | 44 | |
| 2025-05-28 | 2025-06-02 | $356.90 | $342.69 | -3.78% | 4 | |
| 2025-05-19 | 2025-05-22 | $342.09 | $341.04 | -3.67% | 4 | |
| 2025-01-31 | 2025-02-04 | $404.60 | $392.21 | -3.46% | 3 | |
| 2024-12-11 | 2024-12-23 | $424.77 | $430.60 | 3.98% | 9 | |
| 2020-11-19 | 2021-02-19 | $166.42 | $260.43 | 47.69% | 62 | |
| 2020-11-06 | 2020-11-10 | $143.32 | $136.79 | -3.24% | 3 | |
| 2020-11-04 | 2020-11-05 | $140.33 | $146.03 | -0.71% | 2 | |
| 2020-10-13 | 2020-10-29 | $148.88 | $136.94 | -6.73% | 13 | |
| 2020-08-31 | 2020-09-01 | $166.11 | $158.35 | 9.89% | 2 | |
| 2020-08-26 | 2020-08-27 | $143.54 | $149.25 | 4.97% | 2 | |
| 2020-08-10 | 2020-08-12 | $94.57 | $103.65 | -4.48% | 3 | |
| 2020-05-27 | 2020-07-06 | $54.68 | $91.44 | 36.82% | 28 | |
| 2019-12-17 | 2020-01-31 | $25.27 | $43.37 | 51.65% | 31 | |
| 2017-10-05 | 2017-10-10 | $23.69 | $23.71 | -2.87% | 4 | |
| 2017-09-18 | 2017-09-26 | $25.67 | $23.02 | -7.53% | 7 | |
| 2017-08-15 | 2017-08-18 | $24.16 | $23.16 | -2.77% | 4 | |
| 2017-08-04 | 2017-08-07 | $23.79 | $23.68 | 2.10% | 2 | |
| 2017-06-05 | 2017-07-06 | $23.15 | $20.59 | -3.05% | 23 | |
| 2017-05-12 | 2017-05-19 | $21.65 | $20.72 | -2.63% | 6 | |
| 2017-04-24 | 2017-05-10 | $20.54 | $21.68 | 3.99% | 13 | |
| 2017-04-20 | 2017-04-21 | $20.17 | $20.37 | -0.95% | 2 | |
| 2017-03-28 | 2017-04-04 | $18.50 | $20.25 | 8.17% | 6 | |
| 2017-02-03 | 2017-02-28 | $16.76 | $16.67 | -1.76% | 17 | |
| 2017-01-25 | 2017-01-31 | $16.96 | $16.80 | -1.41% | 5 | |
| 2014-04-03 | 2014-04-04 | $15.03 | $14.15 | -1.86% | 2 | |
| 2014-03-20 | 2014-03-26 | $15.66 | $14.20 | -5.39% | 5 | |
| 2014-02-13 | 2014-02-26 | $13.31 | $16.87 | 21.13% | 9 | |
| 2013-11-05 | 2013-11-07 | $11.79 | $9.32 | -11.10% | 3 | |
| 2013-10-25 | 2013-10-28 | $11.31 | $10.86 | -1.77% | 2 | |
| 2013-09-09 | 2013-10-24 | $10.71 | $11.54 | -1.12% | 34 | |
| 2013-06-26 | 2013-07-17 | $7.05 | $8.02 | 5.33% | 15 | |
| 2013-04-30 | 2013-05-08 | $3.60 | $3.72 | 0.77% | 7 | |
| 2013-02-14 | 2013-02-15 | $2.55 | $2.47 | -0.53% | 2 | |
| 2013-01-24 | 2013-02-12 | $2.47 | $2.53 | 5.21% | 14 | |