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.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
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/
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
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/
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.