LongTermTrend_V0812
ARCHIVEDhybridllmAdded regime gating to only trade in UPTREND / low-medium volatility and non-extreme bubble; revamped entry to require either 100-day trend + positive 50-day slope or a 20-day breakout with short-term momentum; added volatility filter on entry (vol_pctile < 0.75); implemented tiered position sizing by vol_pctile (scale down in high vol) and slightly increase size when 50-day slope is strong; strengthened exits to include a 20-day stop-loss (-3%), a drawdown stop (-12%), and a faster exit on breakdown below sma_50 with a 1-day drop. Reduced base position to 0.7 to lower portfolio risk.
Lineage
entry from LongTermTrend_V0323, exit from PriceMomentum_V0449
Strategy Logic (pseudocode)
# LongTermTrend_V0812 [hybrid]
require regime.trend in ['UPTREND']
require regime.volatility in ['LOW_VOLATILITY', 'MEDIUM_VOLATILITY']
require regime.bubble in ['NORMAL']
if flat and (((close > sma_100 and sma_50_slope > 0.0) or (breakout_20 == 1 and ret_5d > 0.02)) and cumret_252d > -0.2 and vol_pctile < 0.75):
position = 0.7
if long and (ret_20d < -0.03 or drawdown < -0.12 or (close < sma_50 and ret_1d < -0.02)):
position = 0.0 # exit to cashBacktest Metrics
| Metric | Train | Validation | Hidden Test | Full |
|---|---|---|---|---|
| CAGR | -2.5% | -4.3% | -4.1% | -3.3% |
| Total Return | -18.3% | -12.3% | -14.5% | -38.8% |
| Sharpe | -0.16 | -0.22 | -0.27 | -0.20 |
| Sortino | -0.10 | -0.13 | -0.15 | -0.12 |
| Calmar | -0.08 | -0.16 | -0.17 | -0.07 |
| Volatility | 11.5% | 14.8% | 12.5% | 12.5% |
| Max DD | -33.2% | -27.1% | -24.3% | -47.1% |
| Win Rate | 40.7% | 39.6% | 50.7% | 43.3% |
| Avg Win | 1.8% | 2.8% | 1.9% | 2.0% |
| Avg Loss | -1.5% | -2.1% | -2.3% | -1.8% |
| Payoff | 1.24 | 1.32 | 0.82 | 1.11 |
| Expectancy | -0.1% | -0.2% | -0.2% | -0.2% |
| Profit Factor | 0.85 | 0.87 | 0.84 | 0.85 |
| Trades | 123 | 53 | 71 | 247 |
| Avg Holding Days | 3.5 | 2.6 | 2.3 | 3.0 |
| Turnover | 21.6 | 24.7 | 26.8 | 23.5 |
| Exposure | 10.6% | 7.9% | 7.0% | 9.1% |
Growth of $100
Walk-Forward Years
| Year | CAGR | Sharpe | Max DD | Trades |
|---|---|---|---|---|
| 2016 | -12.6% | -1.62 | -17.6% | 20 |
| 2017 | 13.0% | 1.99 | -1.7% | 20 |
| 2018 | -15.4% | -1.66 | -15.3% | 4 |
| 2019 | 0.5% | 0.11 | -8.0% | 7 |
| 2020 | 0.0% | 0.00 | 0.0% | 0 |
| 2021 | -0.6% | 0.07 | -21.2% | 37 |
| 2022 | -19.4% | -1.67 | -21.7% | 15 |
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 | 272 | 0.0% | 0.00 | 0% |
| hidden test | EXPENSIVE | 83 | 29.5% | 2.44 | 2% |
| hidden test | EXTREME | 48 | 0.0% | 0.00 | 0% |
| hidden test | HIGH VOLATILITY | 254 | -12.2% | -1.45 | 1% |
| hidden test | LOW VOLATILITY | 432 | -4.1% | -0.41 | 9% |
| hidden test | MEDIUM VOLATILITY | 250 | 6.7% | 0.37 | 11% |
| hidden test | NORMAL | 805 | -7.0% | -0.54 | 8% |
| hidden test | SIDEWAYS | 293 | -7.9% | -1.31 | 1% |
| hidden test | UPTREND | 371 | -2.4% | -0.12 | 17% |
| train | DOWNTREND | 518 | 0.0% | 0.00 | 0% |
| train | EXPENSIVE | 311 | 9.3% | 1.84 | 1% |
| train | EXTREME | 100 | 0.0% | 0.00 | 0% |
| train | HIGH VOLATILITY | 699 | 0.3% | 0.03 | 1% |
| train | LOW VOLATILITY | 745 | 3.1% | 0.25 | 19% |
| train | MEDIUM VOLATILITY | 568 | -11.1% | -0.88 | 12% |
| train | NORMAL | 1,601 | -4.2% | -0.33 | 13% |
| train | SIDEWAYS | 592 | -5.6% | -0.99 | 1% |
| train | UPTREND | 902 | -0.5% | -0.03 | 23% |
| 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 | 3.4% | 0.27 | 1% |
| validation | LOW VOLATILITY | 183 | 5.6% | 0.62 | 16% |
| validation | MEDIUM VOLATILITY | 315 | -14.0% | -0.76 | 9% |
| validation | NORMAL | 474 | -5.3% | -0.28 | 13% |
| validation | SIDEWAYS | 206 | -16.8% | -1.55 | 1% |
| validation | UPTREND | 425 | 2.3% | 0.12 | 14% |
Trades (full period)
| Entry | Exit | Entry Px | Exit Px | Return | Days | |
|---|---|---|---|---|---|---|
| 2026-07-01 | 2026-07-02 | $425.30 | $393.45 | 0.64% | 2 | |
| 2026-05-29 | 2026-06-01 | $435.79 | $415.88 | -1.14% | 2 | |
| 2026-01-08 | 2026-01-13 | $435.80 | $447.20 | 2.69% | 4 | |
| 2026-01-06 | 2026-01-07 | $432.96 | $431.41 | -3.04% | 2 | |
| 2025-12-03 | 2026-01-05 | $446.74 | $451.67 | 1.43% | 22 | |
| 2025-11-28 | 2025-12-02 | $430.17 | $429.24 | 0.44% | 3 | |
| 2025-11-25 | 2025-11-26 | $419.40 | $426.58 | 0.13% | 2 | |
| 2025-11-21 | 2025-11-24 | $391.09 | $417.78 | -0.87% | 2 | |
| 2025-11-19 | 2025-11-20 | $403.99 | $395.23 | 0.34% | 2 | |
| 2025-11-17 | 2025-11-18 | $408.92 | $401.25 | 0.65% | 2 | |
| 2025-11-13 | 2025-11-14 | $401.99 | $404.35 | -4.79% | 2 | |
| 2025-09-12 | 2025-09-15 | $395.94 | $410.04 | 5.01% | 2 | |
| 2025-09-04 | 2025-09-05 | $338.53 | $350.84 | 0.79% | 2 | |
| 2025-07-31 | 2025-08-01 | $308.27 | $302.63 | -2.50% | 2 | |
| 2025-07-29 | 2025-07-30 | $321.20 | $319.04 | -1.08% | 2 | |
| 2025-07-24 | 2025-07-25 | $305.30 | $316.06 | -5.87% | 2 | |
| 2025-07-22 | 2025-07-23 | $332.11 | $332.56 | 0.63% | 2 | |
| 2025-07-18 | 2025-07-21 | $329.65 | $328.49 | 2.10% | 2 | |
| 2025-07-16 | 2025-07-17 | $321.67 | $319.41 | 2.31% | 2 | |
| 2025-07-14 | 2025-07-15 | $316.90 | $310.78 | 0.62% | 2 | |
| 2025-07-10 | 2025-07-11 | $309.87 | $313.51 | 3.17% | 2 | |
| 2025-06-04 | 2025-06-05 | $332.05 | $284.70 | -2.62% | 2 | |
| 2025-06-02 | 2025-06-03 | $342.69 | $344.27 | -0.90% | 2 | |
| 2025-05-27 | 2025-05-28 | $362.89 | $356.90 | 4.71% | 2 | |
| 2025-05-22 | 2025-05-23 | $341.04 | $339.34 | 1.20% | 2 | |
| 2024-10-21 | 2024-10-22 | $218.85 | $217.97 | -0.73% | 2 | |
| 2024-10-17 | 2024-10-18 | $220.89 | $220.70 | -0.28% | 2 | |
| 2024-10-15 | 2024-10-16 | $219.57 | $221.33 | -0.01% | 2 | |
| 2024-10-11 | 2024-10-14 | $217.80 | $219.16 | -6.28% | 2 | |
| 2024-10-09 | 2024-10-10 | $241.05 | $238.77 | -1.13% | 2 | |
| 2024-10-07 | 2024-10-08 | $240.83 | $244.50 | -2.73% | 2 | |
| 2024-10-03 | 2024-10-04 | $240.66 | $250.08 | -2.49% | 2 | |
| 2024-09-26 | 2024-09-27 | $254.22 | $260.46 | -0.90% | 2 | |
| 2024-09-24 | 2024-09-25 | $254.27 | $257.02 | 1.05% | 2 | |
| 2024-09-18 | 2024-09-19 | $227.20 | $243.92 | -0.35% | 2 | |
| 2024-09-16 | 2024-09-17 | $226.78 | $227.87 | -1.21% | 2 | |
| 2024-09-06 | 2024-09-09 | $210.73 | $216.27 | -6.05% | 2 | |
| 2024-09-04 | 2024-09-05 | $219.41 | $230.17 | 2.79% | 2 | |
| 2024-08-30 | 2024-09-03 | $214.11 | $210.60 | 2.52% | 2 | |
| 2024-07-11 | 2024-07-12 | $241.03 | $248.23 | -6.05% | 2 | |
| 2024-07-09 | 2024-07-10 | $262.33 | $263.26 | 2.46% | 2 | |
| 2024-07-05 | 2024-07-08 | $251.52 | $252.94 | 1.32% | 2 | |
| 2024-07-02 | 2024-07-03 | $231.26 | $246.39 | 6.99% | 2 | |
| 2024-01-03 | 2024-01-04 | $238.45 | $237.93 | -2.95% | 2 | |
| 2023-08-24 | 2023-08-25 | $230.04 | $238.59 | -2.15% | 2 | |
| 2023-08-15 | 2023-08-16 | $232.96 | $225.60 | -2.12% | 2 | |
| 2023-08-11 | 2023-08-14 | $242.65 | $239.76 | -0.91% | 2 | |
| 2023-08-09 | 2023-08-10 | $242.19 | $245.34 | -2.24% | 2 | |
| 2023-08-07 | 2023-08-08 | $251.45 | $249.70 | -0.80% | 2 | |
| 2023-08-03 | 2023-08-04 | $259.32 | $253.86 | 1.29% | 2 | |
| 2023-08-01 | 2023-08-02 | $261.07 | $254.11 | -1.80% | 2 | |
| 2023-07-28 | 2023-07-31 | $266.44 | $267.43 | 2.80% | 2 | |
| 2023-07-26 | 2023-07-27 | $264.35 | $255.71 | -0.39% | 2 | |
| 2023-07-24 | 2023-07-25 | $269.06 | $265.28 | 2.29% | 2 | |
| 2023-07-20 | 2023-07-21 | $262.90 | $260.02 | -6.95% | 2 | |
| 2023-07-18 | 2023-07-19 | $293.34 | $291.26 | 0.57% | 2 | |
| 2023-07-14 | 2023-07-17 | $281.38 | $290.38 | 0.74% | 2 | |
| 2023-07-12 | 2023-07-13 | $271.99 | $277.90 | 0.43% | 2 | |
| 2023-07-10 | 2023-07-11 | $269.61 | $269.79 | -1.37% | 2 | |
| 2023-07-06 | 2023-07-07 | $276.54 | $274.43 | -1.61% | 2 | |
| 2023-07-03 | 2023-07-05 | $279.82 | $282.48 | 4.68% | 2 | |
| 2023-06-29 | 2023-06-30 | $257.50 | $261.77 | 0.20% | 2 | |
| 2023-06-27 | 2023-06-28 | $250.21 | $256.24 | 2.52% | 2 | |
| 2023-06-23 | 2023-06-26 | $256.60 | $241.05 | -2.26% | 2 | |
| 2023-06-21 | 2023-06-22 | $259.46 | $264.61 | -3.96% | 2 | |
| 2023-06-16 | 2023-06-20 | $260.54 | $274.45 | 1.13% | 2 | |
| 2023-06-14 | 2023-06-15 | $256.79 | $255.90 | -0.66% | 2 | |
| 2023-06-12 | 2023-06-13 | $249.83 | $258.71 | 1.41% | 2 | |
| 2023-06-08 | 2023-06-09 | $234.86 | $244.40 | 3.07% | 2 | |
| 2023-06-06 | 2023-06-07 | $221.31 | $224.57 | 1.05% | 2 | |
| 2023-06-02 | 2023-06-05 | $213.97 | $217.61 | 2.03% | 2 | |
| 2022-09-21 | 2022-09-22 | $300.80 | $288.59 | -1.94% | 2 | |
| 2022-09-19 | 2022-09-20 | $309.07 | $308.73 | 1.18% | 2 | |
| 2022-09-15 | 2022-09-16 | $303.75 | $303.35 | 0.12% | 2 | |
| 2022-09-12 | 2022-09-13 | $304.42 | $292.13 | 0.97% | 2 | |
| 2022-08-18 | 2022-08-19 | $302.87 | $296.67 | -0.40% | 2 | |
| 2022-08-16 | 2022-08-17 | $306.56 | $304.00 | -0.76% | 2 | |
| 2022-08-05 | 2022-08-08 | $288.17 | $290.42 | -4.78% | 2 | |
| 2022-04-26 | 2022-04-27 | $292.14 | $293.84 | -8.66% | 2 | |
| 2022-04-22 | 2022-04-25 | $335.02 | $332.67 | -0.40% | 2 | |
| 2022-04-20 | 2022-04-21 | $325.73 | $336.26 | -3.61% | 2 | |
| 2022-04-18 | 2022-04-19 | $334.76 | $342.72 | 1.23% | 2 | |
| 2022-04-13 | 2022-04-14 | $340.79 | $328.33 | 2.37% | 2 | |
| 2022-04-08 | 2022-04-11 | $341.83 | $325.31 | -2.24% | 2 | |
| 2022-04-05 | 2022-04-07 | $363.75 | $352.42 | -6.27% | 3 | |
| 2022-01-12 | 2022-01-13 | $368.74 | $343.85 | 2.61% | 2 | |
| 2022-01-03 | 2022-01-04 | $399.93 | $383.20 | 9.33% | 2 | |
| 2021-12-30 | 2021-12-31 | $356.78 | $352.26 | -1.16% | 2 | |
| 2021-12-27 | 2021-12-29 | $364.65 | $362.06 | 1.27% | 3 | |
| 2021-12-22 | 2021-12-23 | $336.29 | $355.67 | 5.10% | 2 | |
| 2021-12-20 | 2021-12-21 | $299.98 | $312.84 | -2.59% | 2 | |
| 2021-12-16 | 2021-12-17 | $308.97 | $310.86 | -3.66% | 2 | |
| 2021-12-14 | 2021-12-15 | $319.50 | $325.33 | -0.71% | 2 | |
| 2021-12-10 | 2021-12-13 | $339.01 | $322.14 | 0.78% | 2 | |
| 2021-12-08 | 2021-12-09 | $356.32 | $334.60 | 1.00% | 2 | |
| 2021-12-06 | 2021-12-07 | $336.34 | $350.58 | -0.55% | 2 | |
| 2021-12-02 | 2021-12-03 | $361.53 | $338.32 | -0.80% | 2 | |
| 2021-11-30 | 2021-12-01 | $381.59 | $365.00 | 0.34% | 2 | |
| 2021-11-23 | 2021-11-29 | $369.68 | $379.00 | -4.69% | 4 | |
| 2021-10-04 | 2021-11-10 | $260.51 | $355.98 | 21.92% | 28 |