OPEN-SOURCE SCRIPT
Leveraged ETF Strategy Tester

A comprehensive backtesting tool for comparing three distinct leveraged ETF investment strategies with customizable parameters, visual indicators, and risk metrics.
Features:
Strategy 1: Stars (Lee Ekholm)
A rebalancing strategy that maintains a conservative 20% TQQQ / 80% SPY base allocation with an automatic risk-on mechanism during severe drawdowns.
How it works:
Strategy 2: BD Collins 80/20 DCA
A four-tier dollar-cost averaging strategy that deploys cash more aggressively as drawdowns deepen, automatically buying more during corrections.
How it works:
Strategy 3: Henrique Centieiro's Strategy (1/3 Cash)
A simplified three-tier approach with clear escalating deployment levels based on drawdown severity.
How it works:
Color-Coded Buy Signals:
Strategy 1: Aqua (normal) | Orange (40% trigger active)
Strategy 2: Green (20%) | Yellow (40%) | Orange (60%) | Red (80%)
Strategy 3: Green (20-33%) | Orange (67%) | Red (100%)
Note: This indicator is for educational and backtesting purposes. Past performance does not guarantee future results. Leveraged ETFs carry significant risk and may not be suitable for all investors.
Features:
- Test three proven strategies side-by-side
- Fully customizable parameters via settings
- Visual buy signals color-coded by deployment tier
- ATH tracking and drawdown bands
- Monthly contribution support
- Sharpe and Sortino ratios for risk assessment
- Separate tables for statistics and strategy descriptions
Strategy 1: Stars (Lee Ekholm)
A rebalancing strategy that maintains a conservative 20% TQQQ / 80% SPY base allocation with an automatic risk-on mechanism during severe drawdowns.
How it works:
- Annual rebalancing at 20/80 allocation
- When TQQQ drops 40%+, shifts to 40% TQQQ at next rebalance
- Skips rebalancing for 1 year after market bottoms
- Resets to base allocation after TQQQ recovers to new ATH
- Monthly contributions accumulate and deploy during rebalances
- Best for: Long-term investors seeking systematic exposure increase during crashes
Strategy 2: BD Collins 80/20 DCA
A four-tier dollar-cost averaging strategy that deploys cash more aggressively as drawdowns deepen, automatically buying more during corrections.
How it works:
- Accumulates monthly contributions as cash reserves
- Deploys at quarterly intervals (customizable)
- 4 deployment tiers based on drawdown from ATH:
- 0-15%: Deploy 20% of cash
- 15-25%: Deploy 40% of cash
- 25-35%: Deploy 60% of cash
- 35%+: Deploy 80% of cash
- Best for: Investors wanting automated "buy the dip" behavior with increasing aggression
Strategy 3: Henrique Centieiro's Strategy (1/3 Cash)
A simplified three-tier approach with clear escalating deployment levels based on drawdown severity.
How it works:
- Baseline: 20% deployment near ATH
- 20% drop: 33% deployment (1/3)
- 40% drop: 67% deployment (2/3)
- 60% drop: 100% deployment (full cash)
- Monthly contributions accumulate and deploy at chosen cadence
- Best for: Investors preferring a simpler, more aggressive deployment schedule with clear trigger points
Color-Coded Buy Signals:
Strategy 1: Aqua (normal) | Orange (40% trigger active)
Strategy 2: Green (20%) | Yellow (40%) | Orange (60%) | Red (80%)
Strategy 3: Green (20-33%) | Orange (67%) | Red (100%)
Note: This indicator is for educational and backtesting purposes. Past performance does not guarantee future results. Leveraged ETFs carry significant risk and may not be suitable for all investors.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Hedge Fund Manager at Maverick Capital | Wealth Educator | 20+ yrs investing | Stocks, ETFs & Crypto alerts | Join Henrique Wealth Academy for trade alerts & indicators → skool.com/be-limitless/
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Hedge Fund Manager at Maverick Capital | Wealth Educator | 20+ yrs investing | Stocks, ETFs & Crypto alerts | Join Henrique Wealth Academy for trade alerts & indicators → skool.com/be-limitless/
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.