OPEN-SOURCE SCRIPT
SPXL - Buy The Panic VIX

VIX ≥ 25 = Fear - Buy
VIX ≥ 32 = Max Fear - Aggressive Buy
VIX ≤ 16 = Complacency - Sell
Indicators:
Used mainly for sell confirmation:
Price above EMA200 → bullish trend
RSI > 65 → overbought
Price stretched above EMA → overextended
State machine:
This strategy is NOT just signals — it tracks position state:
0 = no position
1 = first buy (60%)
2 = second buy (85%)
3 = full position (100%)
4 = sold half (core position)
5 = reloaded
Scales in
Takes partial profits
Reloads later
Position sizing
shares_first = 60% of capital
shares_second = 25%
shares_third = 15%
Reload uses 80% of available cash
Sell = 50% of position
Sell
1. Market is overbought
2. Trend is strong
3. Volatility is low
sell_trigger (confirmed euphoria)
AND RSI > 65
AND price stretched
AND price above EMA200
Onsly sells 50%, doesnt fully exit
Max drawdown protection + Cooldown to prevent overtrading
Visuals
EMA lines
Entry price
Drawdown level
Background colors:
Purple = extreme panic
Red = panic
Green = euphoria
Dashbord
VIX level & zone
Current state
Drawdown
Shares held
Cash available
Next action
How it works:
During a crash:
VIX spikes → no buy yet
VIX starts falling → BUY 60%
Keeps falling → ADD 25%
Extreme panic → ADD 15% (full)
During recovery:
Market rallies → hold
VIX drops to low levels → wait for confirmation
Euphoria confirmed → SELL 50%
If panic returns:
Reload → buy again
WHY THIS STRATEGY IS POWERFUL
Doesn’t try to time exact bottoms
Uses volatility instead of price guessing
Scales in/out (professional behavior)
Avoids emotional trading
Keeps a core position (captures long trends)
VIX ≥ 32 = Max Fear - Aggressive Buy
VIX ≤ 16 = Complacency - Sell
Indicators:
Used mainly for sell confirmation:
Price above EMA200 → bullish trend
RSI > 65 → overbought
Price stretched above EMA → overextended
State machine:
This strategy is NOT just signals — it tracks position state:
0 = no position
1 = first buy (60%)
2 = second buy (85%)
3 = full position (100%)
4 = sold half (core position)
5 = reloaded
Scales in
Takes partial profits
Reloads later
Position sizing
shares_first = 60% of capital
shares_second = 25%
shares_third = 15%
Reload uses 80% of available cash
Sell = 50% of position
Sell
1. Market is overbought
2. Trend is strong
3. Volatility is low
sell_trigger (confirmed euphoria)
AND RSI > 65
AND price stretched
AND price above EMA200
Onsly sells 50%, doesnt fully exit
Max drawdown protection + Cooldown to prevent overtrading
Visuals
EMA lines
Entry price
Drawdown level
Background colors:
Purple = extreme panic
Red = panic
Green = euphoria
Dashbord
VIX level & zone
Current state
Drawdown
Shares held
Cash available
Next action
How it works:
During a crash:
VIX spikes → no buy yet
VIX starts falling → BUY 60%
Keeps falling → ADD 25%
Extreme panic → ADD 15% (full)
During recovery:
Market rallies → hold
VIX drops to low levels → wait for confirmation
Euphoria confirmed → SELL 50%
If panic returns:
Reload → buy again
WHY THIS STRATEGY IS POWERFUL
Doesn’t try to time exact bottoms
Uses volatility instead of price guessing
Scales in/out (professional behavior)
Avoids emotional trading
Keeps a core position (captures long trends)
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.