OPEN-SOURCE SCRIPT
Vol-Target Trend Engine

WHAT IT DOES
VTTE is a leveraged-ETF allocation engine. It holds a 3x index ETF (built for TQQQ/UPRO) only during favorable regimes, and lets realized volatility set the position size. There is no entry signal being predicted anywhere in the script - the edge is the risk-allocation policy itself, which is why the system has almost no tunable surface to overfit.
HOW IT WORKS
1) REGIME GATE - the position exists only while price trades above its 200-day SMA. Leveraged ETFs suffer volatility decay fastest in downtrends; the gate removes the catastrophic left tail instead of trying to predict it. Below the SMA the system is 100% cash.
2) VOLATILITY TARGETING - exposure = min(100%, target vol / realized vol), using 20-day realized volatility annualized against a 45% target. This is the same architecture vol-control indices and risk-parity desks run: position size shrinks mechanically as volatility expands, which front-runs drawdowns because volatility clusters.
3) REBALANCING - weekly, inside a 10% tolerance band to keep turnover and commission drag low, with an immediate de-risk override when held exposure runs 1.5x over target. Regime flips act immediately.
BACKTEST PROPERTIES (fully disclosed)
0.05% commission per side, 1 tick slippage, fills on close, $10,000 initial. TQQQ daily Feb 2010 - Aug 2026: +3,862% realized net, profit factor 3.33, 155 rebalance events (67.7% profitable), max drawdown 41.9%. Buy-and-hold TQQQ returned more over the same window (+20,107%) but with multiple drawdowns beyond 80%; the S&P 500 returned roughly +630%. The honest comparison is CAGR ~26% at roughly half of buy-and-hold's worst drawdown.
WHAT WAS TESTED AND REJECTED
A faster variant (5-day vol estimate, de-risk any day of the week) was tested and REJECTED with numbers: turnover more than doubled, the system repeatedly sold volatility spikes at their lows and re-bought higher, net return fell from +3,862% to +2,158%, profit factor 3.33 to 1.98, and max drawdown got WORSE (41.9% to 49.6%). Slow rebalancing is a feature, not a limitation.
INPUTS
Realized vol lookback (20d), target annualized vol (45%), regime SMA length (200), rebalance band (10%), fast de-risk toggle.
LIMITATIONS
Single instrument, single history, in-sample. TQQQ's listed history begins in 2010 - a mostly secular-bull window; the regime gate carries the 2020 and 2022 stress periods, but the configuration has not been walk-forward validated yet. Treat every figure as an upper bound on expectancy, not a forecast. Not financial advice.
VTTE is a leveraged-ETF allocation engine. It holds a 3x index ETF (built for TQQQ/UPRO) only during favorable regimes, and lets realized volatility set the position size. There is no entry signal being predicted anywhere in the script - the edge is the risk-allocation policy itself, which is why the system has almost no tunable surface to overfit.
HOW IT WORKS
1) REGIME GATE - the position exists only while price trades above its 200-day SMA. Leveraged ETFs suffer volatility decay fastest in downtrends; the gate removes the catastrophic left tail instead of trying to predict it. Below the SMA the system is 100% cash.
2) VOLATILITY TARGETING - exposure = min(100%, target vol / realized vol), using 20-day realized volatility annualized against a 45% target. This is the same architecture vol-control indices and risk-parity desks run: position size shrinks mechanically as volatility expands, which front-runs drawdowns because volatility clusters.
3) REBALANCING - weekly, inside a 10% tolerance band to keep turnover and commission drag low, with an immediate de-risk override when held exposure runs 1.5x over target. Regime flips act immediately.
BACKTEST PROPERTIES (fully disclosed)
0.05% commission per side, 1 tick slippage, fills on close, $10,000 initial. TQQQ daily Feb 2010 - Aug 2026: +3,862% realized net, profit factor 3.33, 155 rebalance events (67.7% profitable), max drawdown 41.9%. Buy-and-hold TQQQ returned more over the same window (+20,107%) but with multiple drawdowns beyond 80%; the S&P 500 returned roughly +630%. The honest comparison is CAGR ~26% at roughly half of buy-and-hold's worst drawdown.
WHAT WAS TESTED AND REJECTED
A faster variant (5-day vol estimate, de-risk any day of the week) was tested and REJECTED with numbers: turnover more than doubled, the system repeatedly sold volatility spikes at their lows and re-bought higher, net return fell from +3,862% to +2,158%, profit factor 3.33 to 1.98, and max drawdown got WORSE (41.9% to 49.6%). Slow rebalancing is a feature, not a limitation.
INPUTS
Realized vol lookback (20d), target annualized vol (45%), regime SMA length (200), rebalance band (10%), fast de-risk toggle.
LIMITATIONS
Single instrument, single history, in-sample. TQQQ's listed history begins in 2010 - a mostly secular-bull window; the regime gate carries the 2020 and 2022 stress periods, but the configuration has not been walk-forward validated yet. Treat every figure as an upper bound on expectancy, not a forecast. Not financial advice.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.