Recovery Zone Hedging [Starbots]

It opens an initial trade (Short by default) based on selected technical signals (MACD, DMI, etc.).
If price moves against the position, where a traditional Stop Loss would normally be triggered and fails to hit Take Profit, the strategy initiates a Hedge trade in the opposite direction at a calculated recovery level. Each hedge increases in size, aiming to recover accumulated losses and close the entire sequence in profit.
⚙️ Key Features
✅ Recovery Zone Logic
- Uses a configurable percentage-based spacing to define recovery zones.
- Opens alternating hedge trades as price continues to move against the position.
- Trade size increases exponentially using a hedge multiplier.
✅ Entry Signal Options
- MACD Signal: Generates entry signals based on the standard MACD line crossing above or below the signal line using default parameter settings.
- DMI Signal: Triggers entries when the +DI crosses below or above the –DI, following the default Directional Movement Index parameters.
- Random Entry: Periodically initiates trades to maintain an active position for robustness testing and strategy evaluation.
✅ Take-Profit Logic
- Dynamically calculated to ensure full recovery of any floating or realized losses.
- Incorporates accumulated drawdown into the take-profit formula for each trade cycle.
✅ Capital Usage Dashboard
- Displays real-time equity requirement per hedge step.
- Highlights in red when usage would exceed 100% of account equity.
✅ Fail-Safe Exit Option
- Optionally - forces a stop-out beyond the final allowed hedge level.
- Helps limit risk in volatile or low-momentum conditions.
📉 How It Works
- Initial Trade: A short trade is placed when the entry condition is met.
- Recovery Logic: If price moves in the wrong direction:
A hedge trade is triggered in the opposite direction at the defined recovery zone.
Each hedge uses a larger position size based on your hedge factor. - Cycle Repeats: Continues alternating hedge trades until either:
The dynamically calculated take profit is reached (closing all trades), or
The maximum hedge count is reached and price moves beyond the last recovery zone (triggering a forced exit if enabled).
📊 Built-in Visuals & Tools
- Recovery Zones and TP levels plotted directly on chart.
- Visualized long and short hedge thresholds.
- Equity usage table based on your settings.
- Built-in monthly and yearly performance calendar.
⚠️ Important Notes
- TradingView only supports one open direction at a time, so this strategy simulates hedging by alternating long and short trades.
- The position sizing grows quickly with each hedge — carefully manage your settings to avoid over-leveraging.
- Best used in trending markets. Prolonged sideways markets can trigger multiple hedges without hitting TP.
🧮 Equity Usage Guidance
The Equity Usage Dashboard shows how much capital is required throughout the hedge sequence.
If your projected usage exceeds 100% of equity before TP, you should:
-Reduce the initial trade size
-Lower the hedge multiplier
-Reduce the maximum number of hedge trades
(for safer trading, it’s recommended to keep usage below 10% of your total equity)
🧠 Recommended Settings
Parameter Suggested Range Description
Initial Position Size 1–5% Base size of the first trade
Recovery Zone (%) 2–5% Distance between recovery entries
Hedge Factor 1.4–1.9 Multiplier for hedge size increase
Max Hedge Trades 4–6 Number of hedge steps allowed
🛠️ Strategy Use Case
This strategy is designed for educational and simulation purposes. It helps traders visualize how compounding hedge systems behave in different market conditions, and better understand the impact of volatility, trend strength, and timing on recovery-based models.
Turn it on to filter out low volatility market when signals occur
- Added tooltip to 'Take Profit [%]' so users understand how accumulated loss increases your Take Profit when your strategy is in negative P%L
📈 Visual Example:
Let’s say:
Entry price = $100
TP% = 2%
Position size = 1
No prior loss → TP = 100 + (2% of 100) = $102
With $5 accumulated loss → TP = 100 + (5 / 1) + (2% of 100) = $107
Now the trade must reach $107, not $102, to:
Cover the previous $5 loss
And still earn a 2% profit on the current trade
✅ Our TP target dynamically increases to make up for past losses.
Script su invito
Solo gli utenti approvati dall'autore possono accedere a questo script. È necessario richiedere e ottenere l'autorizzazione per utilizzarlo. Tale autorizzazione viene solitamente concessa dopo il pagamento. Per ulteriori dettagli, seguire le istruzioni dell'autore riportate di seguito o contattare direttamente Starbots.
TradingView NON consiglia di pagare o utilizzare uno script a meno che non ci si fidi pienamente del suo autore e non si comprenda il suo funzionamento. Puoi anche trovare alternative gratuite e open-source nei nostri script della comunità.
Istruzioni dell'autore
Attenzione: prima di richiedere l'accesso, leggi la nostra guida per gli script su invito.
Declinazione di responsabilità
Script su invito
Solo gli utenti approvati dall'autore possono accedere a questo script. È necessario richiedere e ottenere l'autorizzazione per utilizzarlo. Tale autorizzazione viene solitamente concessa dopo il pagamento. Per ulteriori dettagli, seguire le istruzioni dell'autore riportate di seguito o contattare direttamente Starbots.
TradingView NON consiglia di pagare o utilizzare uno script a meno che non ci si fidi pienamente del suo autore e non si comprenda il suo funzionamento. Puoi anche trovare alternative gratuite e open-source nei nostri script della comunità.
Istruzioni dell'autore
Attenzione: prima di richiedere l'accesso, leggi la nostra guida per gli script su invito.