LongTermTrend_V0964
ARCHIVEDhybridllm['Added explicit trend and volatility regime gating: require UPTREND, LOW_VOLATILITY, and NORMAL bubble to avoid trading in unfavorable regimes.', 'Tightened short-term momentum and mean trend checks: require close > sma_50 and sma_50_slope > 0 to ensure entries align with intermediate trend.', 'Loosened daily drawdown threshold slightly (ret_1d > -0.04) to avoid entering immediately after large one-day selloffs while being less fragile than original.', 'Added vol_pctile < 0.8 filter inside entry to avoid initiating positions in elevated volatility.', 'Expanded exit to a multi-condition rule: keep original 20d momentum stop, add close crossing below sma_50 and negative macd_hist for earlier, signal-based exits.', 'Introduced position sizing rules: reduce size in high vol (vol_pctile>0.8), reduce near 52-week highs (dist_52w_high<0.05), and allow full size on very strong 20d momentum (>15%).', 'Reduced base_position from 1.0 to 0.60 to lower portfolio-level risk and make sizing rules meaningful.']
Lineage
Parents (1)
swapped indicator ret_20d -> ret_1d
Strategy Logic (pseudocode)
# LongTermTrend_V0964 [hybrid]
if flat and ((((close > sma_200 and sma_200_slope > 0.0) or ret_20d > 0.1) and ret_1d > -0.04 and cumret_252d > -0.4) and (ret_20d > 0.03 and close > sma_50 and sma_50_slope > 0.0 and vol_pctile < 0.8)):
position = 0.6
if long and (ret_20d < -0.1003 or close < sma_50 or macd_hist < 0.0):
position = 0.0 # exit to cashBacktest Metrics
| Metric | Train | Validation | Hidden Test | Full |
|---|
| CAGR | 7.7% | 34.3% | 3.3% | 11.6% |
| Total Return | 80.9% | 142.3% | 12.8% | 403.1% |
| Sharpe | 0.55 | 1.39 | 0.30 | 0.73 |
| Sortino | 0.46 | 1.33 | 0.20 | 0.60 |
| Calmar | 0.22 | 1.20 | 0.17 | 0.34 |
| Volatility | 15.6% | 23.1% | 13.7% | 17.0% |
| Max DD | -34.5% | -28.5% | -18.9% | -34.5% |
| Win Rate | 37.5% | 58.6% | 38.6% | 43.7% |
| Avg Win | 5.0% | 4.5% | 3.9% | 4.8% |
| Avg Loss | -1.8% | -2.0% | -1.9% | -1.9% |
| Payoff | 2.74 | 2.19 | 2.07 | 2.54 |
| Expectancy | 0.7% | 1.8% | 0.4% | 1.0% |
| Profit Factor | 1.64 | 3.11 | 1.30 | 1.97 |
| Trades | 104 | 58 | 44 | 206 |
| Avg Holding Days | 5.3 | 5.0 | 4.7 | 5.2 |
| Turnover | 15.7 | 23.2 | 14.2 | 16.8 |
| Exposure | 13.8% | 18.6% | 10.4% | 13.9% |
Growth of $100
LongTermTrend_V0964 vs TSLA Buy & Hold
LongTermTrend_V0964 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 | 2.8% | 0.49 | -4.2% | 6 |
| 2017 | 5.0% | 0.44 | -11.2% | 22 |
| 2018 | -16.0% | -2.14 | -16.5% | 9 |
| 2019 | 13.1% | 0.79 | -13.7% | 7 |
| 2020 | 141.1% | 2.79 | -11.3% | 24 |
| 2021 | 22.4% | 1.17 | -11.7% | 24 |
| 2022 | -18.2% | -1.95 | -19.0% | 9 |
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 | 275 | 0.0% | 0.00 | 0% |
| hidden test | EXPENSIVE | 83 | 15.9% | 0.82 | 24% |
| hidden test | EXTREME | 48 | 34.5% | 1.60 | 17% |
| hidden test | HIGH VOLATILITY | 254 | -4.4% | -0.33 | 6% |
| hidden test | LOW VOLATILITY | 434 | 19.3% | 1.63 | 11% |
| hidden test | MEDIUM VOLATILITY | 251 | -13.4% | -0.80 | 13% |
| hidden test | NORMAL | 808 | 1.2% | 0.09 | 9% |
| hidden test | SIDEWAYS | 293 | -8.1% | -0.77 | 8% |
| hidden test | UPTREND | 371 | 17.0% | 0.86 | 20% |
| train | DOWNTREND | 518 | 1.6% | 0.74 | 1% |
| train | EXPENSIVE | 311 | 17.4% | 0.87 | 29% |
| train | EXTREME | 100 | 157.4% | 4.03 | 37% |
| train | HIGH VOLATILITY | 699 | 21.7% | 1.03 | 11% |
| train | LOW VOLATILITY | 745 | 8.3% | 0.73 | 20% |
| train | MEDIUM VOLATILITY | 568 | -7.1% | -0.60 | 10% |
| train | NORMAL | 1,601 | -2.4% | -0.21 | 9% |
| train | SIDEWAYS | 592 | -10.3% | -1.13 | 5% |
| train | UPTREND | 902 | 25.1% | 1.14 | 27% |
| validation | DOWNTREND | 125 | 0.0% | 0.00 | 0% |
| validation | EXPENSIVE | 138 | 36.1% | 1.58 | 28% |
| validation | EXTREME | 144 | 141.4% | 3.49 | 34% |
| validation | HIGH VOLATILITY | 258 | 33.5% | 1.13 | 14% |
| validation | LOW VOLATILITY | 183 | 20.6% | 1.73 | 20% |
| validation | MEDIUM VOLATILITY | 315 | 37.8% | 1.71 | 21% |
| validation | NORMAL | 474 | -2.2% | -0.16 | 11% |
| validation | SIDEWAYS | 206 | -3.0% | -0.51 | 3% |
| validation | UPTREND | 425 | 58.7% | 1.92 | 32% |
Trades (full period)
latest 100 of 206
| Entry | Exit | Entry Px | Exit Px | Return | Days | |
|---|
| 2026-06-05 | 2026-06-08 | $391.00 | $408.95 | -4.05% | 2 | |
| 2026-06-03 | 2026-06-04 | $423.70 | $418.45 | -0.13% | 2 | |
| 2026-05-27 | 2026-06-02 | $440.36 | $423.74 | -2.56% | 5 | |
| 2026-05-22 | 2026-05-26 | $426.01 | $433.59 | 1.05% | 2 | |
| 2026-05-14 | 2026-05-21 | $443.30 | $417.85 | -3.89% | 6 | |
| 2025-12-31 | 2026-01-02 | $449.72 | $438.07 | -0.74% | 2 | |
| 2025-12-12 | 2025-12-30 | $458.96 | $454.43 | 1.68% | 12 | |
| 2025-11-10 | 2025-11-11 | $445.23 | $439.62 | 2.07% | 2 | |
| 2025-11-06 | 2025-11-07 | $445.91 | $429.52 | -2.22% | 2 | |
| 2025-11-03 | 2025-11-05 | $468.37 | $462.07 | -1.70% | 3 | |
| 2025-10-29 | 2025-10-30 | $461.51 | $440.10 | 0.01% | 2 | |
| 2025-10-24 | 2025-10-27 | $433.72 | $452.42 | -2.16% | 2 | |
| 2025-10-22 | 2025-10-23 | $438.97 | $448.98 | -0.61% | 2 | |
| 2025-10-20 | 2025-10-21 | $447.43 | $442.60 | 0.99% | 2 | |
| 2025-10-14 | 2025-10-15 | $429.24 | $435.15 | -1.04% | 2 | |
| 2025-10-09 | 2025-10-10 | $435.54 | $413.49 | -0.55% | 2 | |
| 2025-10-07 | 2025-10-08 | $433.09 | $438.69 | -2.79% | 2 | |
| 2025-09-08 | 2025-10-06 | $346.40 | $453.25 | 13.11% | 21 | |
| 2025-09-04 | 2025-09-05 | $338.53 | $350.84 | 0.68% | 2 | |
| 2025-08-25 | 2025-09-03 | $346.60 | $334.09 | -1.98% | 7 | |
| 2025-06-10 | 2025-06-11 | $326.09 | $326.43 | 3.28% | 2 | |
| 2025-06-04 | 2025-06-05 | $332.05 | $284.70 | -2.25% | 2 | |
| 2025-05-16 | 2025-06-03 | $349.98 | $344.27 | -0.04% | 12 | |
| 2024-12-31 | 2025-01-02 | $403.84 | $379.28 | -2.07% | 2 | |
| 2024-12-26 | 2024-12-27 | $454.13 | $431.66 | -1.18% | 2 | |
| 2024-12-06 | 2024-12-24 | $389.22 | $462.28 | 9.79% | 13 | |
| 2024-10-11 | 2024-10-14 | $217.80 | $219.16 | -5.39% | 2 | |
| 2024-10-09 | 2024-10-10 | $241.05 | $238.77 | -0.97% | 2 | |
| 2024-10-07 | 2024-10-08 | $240.83 | $244.50 | -2.34% | 2 | |
| 2024-09-11 | 2024-10-04 | $228.13 | $250.08 | 3.82% | 18 | |
| 2024-09-06 | 2024-09-09 | $210.73 | $216.27 | -5.18% | 2 | |
| 2024-06-27 | 2024-07-22 | $197.42 | $251.51 | 12.85% | 17 | |
| 2024-01-03 | 2024-01-04 | $238.45 | $237.93 | -2.53% | 2 | |
| 2023-07-26 | 2023-07-27 | $264.35 | $255.71 | -0.33% | 2 | |
| 2023-07-18 | 2023-07-19 | $293.34 | $291.26 | 0.49% | 2 | |
| 2023-07-12 | 2023-07-13 | $271.99 | $277.90 | 0.37% | 2 | |
| 2023-07-10 | 2023-07-11 | $269.61 | $269.79 | -1.17% | 2 | |
| 2023-07-05 | 2023-07-07 | $282.48 | $274.43 | -0.82% | 3 | |
| 2023-06-30 | 2023-07-03 | $261.77 | $279.82 | 0.87% | 2 | |
| 2023-06-28 | 2023-06-29 | $256.24 | $257.50 | 1.33% | 2 | |
| 2023-05-31 | 2023-06-27 | $203.93 | $250.21 | 11.59% | 19 | |
| 2023-03-01 | 2023-03-02 | $202.77 | $190.90 | -0.98% | 2 | |
| 2023-02-27 | 2023-02-28 | $207.63 | $205.71 | 3.15% | 2 | |
| 2023-02-10 | 2023-02-23 | $196.89 | $202.07 | -1.81% | 9 | |
| 2022-08-24 | 2022-08-25 | $297.10 | $296.07 | 0.01% | 2 | |
| 2022-08-15 | 2022-08-19 | $309.32 | $296.67 | 0.46% | 5 | |
| 2022-08-02 | 2022-08-12 | $300.59 | $300.03 | -2.19% | 9 | |
| 2022-04-20 | 2022-04-21 | $325.73 | $336.26 | -3.09% | 2 | |
| 2022-04-18 | 2022-04-19 | $334.76 | $342.72 | 1.05% | 2 | |
| 2022-04-13 | 2022-04-14 | $340.79 | $328.33 | 2.03% | 2 | |
| 2022-04-05 | 2022-04-11 | $363.75 | $325.31 | -6.48% | 5 | |
| 2022-01-13 | 2022-01-14 | $343.85 | $349.87 | -4.17% | 2 | |
| 2022-01-04 | 2022-01-07 | $383.20 | $342.32 | -6.97% | 4 | |
| 2021-12-09 | 2021-12-10 | $334.60 | $339.01 | -3.78% | 2 | |
| 2021-11-26 | 2021-11-29 | $360.64 | $379.00 | -1.95% | 2 | |
| 2021-11-22 | 2021-11-23 | $385.62 | $369.68 | 0.92% | 2 | |
| 2021-11-18 | 2021-11-19 | $365.46 | $379.02 | 0.29% | 2 | |
| 2021-11-16 | 2021-11-17 | $351.58 | $363.00 | 2.33% | 2 | |
| 2021-11-12 | 2021-11-15 | $344.47 | $337.80 | -1.82% | 2 | |
| 2021-10-12 | 2021-11-11 | $268.57 | $354.50 | 20.23% | 23 | |
| 2021-10-08 | 2021-10-11 | $261.83 | $263.98 | -0.73% | 2 | |
| 2021-09-28 | 2021-10-07 | $259.19 | $264.54 | -0.77% | 8 | |
| 2021-09-24 | 2021-09-27 | $258.13 | $263.79 | 1.53% | 2 | |
| 2021-09-22 | 2021-09-23 | $250.65 | $251.21 | 0.90% | 2 | |
| 2021-09-01 | 2021-09-21 | $244.70 | $246.46 | -0.53% | 14 | |
| 2021-08-27 | 2021-08-30 | $237.31 | $243.64 | 0.80% | 2 | |
| 2021-08-25 | 2021-08-26 | $237.07 | $233.72 | 0.11% | 2 | |
| 2021-08-23 | 2021-08-24 | $235.43 | $236.16 | 2.18% | 2 | |
| 2021-08-19 | 2021-08-20 | $224.49 | $226.75 | -1.47% | 2 | |
| 2021-08-03 | 2021-08-17 | $236.58 | $221.90 | -2.08% | 11 | |
| 2021-02-10 | 2021-02-11 | $268.27 | $270.55 | -3.27% | 2 | |
| 2021-02-08 | 2021-02-09 | $287.81 | $283.15 | 0.67% | 2 | |
| 2021-02-04 | 2021-02-05 | $283.33 | $284.08 | -0.45% | 2 | |
| 2021-02-02 | 2021-02-03 | $290.93 | $284.90 | 2.23% | 2 | |
| 2021-01-28 | 2021-01-29 | $278.48 | $264.51 | -2.11% | 2 | |
| 2021-01-26 | 2021-01-27 | $294.36 | $288.05 | 0.04% | 2 | |
| 2021-01-05 | 2021-01-25 | $245.04 | $293.60 | 9.48% | 14 | |
| 2020-12-31 | 2021-01-04 | $235.22 | $243.26 | 0.82% | 2 | |
| 2020-12-29 | 2020-12-30 | $222.00 | $231.59 | 0.09% | 2 | |
| 2020-12-24 | 2020-12-28 | $220.59 | $221.23 | 1.35% | 2 | |
| 2020-12-18 | 2020-12-23 | $231.67 | $215.33 | -1.45% | 4 | |
| 2020-11-19 | 2020-12-17 | $166.42 | $218.63 | 16.23% | 20 | |
| 2020-10-26 | 2020-10-27 | $140.09 | $141.56 | -0.17% | 2 | |
| 2020-10-22 | 2020-10-23 | $141.93 | $140.21 | 0.33% | 2 | |
| 2020-10-13 | 2020-10-20 | $148.88 | $140.65 | -1.65% | 6 | |
| 2020-10-09 | 2020-10-12 | $144.67 | $147.43 | 1.02% | 2 | |
| 2020-10-07 | 2020-10-08 | $141.77 | $141.97 | 1.52% | 2 | |
| 2020-08-19 | 2020-09-08 | $125.24 | $110.07 | 6.75% | 14 | |
| 2020-08-14 | 2020-08-17 | $110.05 | $122.38 | 0.98% | 2 | |
| 2020-08-06 | 2020-08-07 | $99.31 | $96.85 | 0.06% | 2 | |
| 2020-08-04 | 2020-08-05 | $99.13 | $99.00 | -0.04% | 2 | |
| 2020-07-02 | 2020-07-27 | $80.58 | $102.64 | 15.78% | 17 | |
| 2020-06-30 | 2020-07-01 | $71.99 | $74.64 | 4.07% | 2 | |
| 2020-06-26 | 2020-06-29 | $63.98 | $67.29 | -1.72% | 2 | |
| 2020-06-03 | 2020-06-25 | $58.86 | $65.73 | 5.47% | 17 | |
| 2020-06-01 | 2020-06-02 | $59.87 | $58.77 | 4.41% | 2 | |
| 2020-05-28 | 2020-05-29 | $53.72 | $55.67 | -1.17% | 2 | |
| 2020-05-26 | 2020-05-27 | $54.59 | $54.68 | 0.03% | 2 | |
| 2020-05-21 | 2020-05-22 | $55.17 | $54.46 | 0.77% | 2 | |
| 2020-05-19 | 2020-05-20 | $53.87 | $54.37 | -0.53% | 2 | |