OPEN-SOURCE SCRIPT
Hidden Divergence PRO MAX v2 (Clean)

### **Hidden Divergence PRO MAX v2 (Clean)**
**Overview**
This is a high-performance, trend-following strategy designed specifically for the Crypto market (e.g., BTCUSDT.P). It utilizes **Hidden Divergence** between Price and RSI to identify trend continuation opportunities with institutional-grade risk management.
**Key Technical Features:**
* **Zero Repaint Logic:** Implements `lookahead=barmerge.lookahead_off` and HTF candle offsets to ensure backtesting results match real-time execution.
* **Multi-Layered Filtering:**
* **Trend Filter:** Uses a Higher Timeframe (HTF) EMA 200 to ensure trades are only taken in the direction of the macro trend.
* **Volume Exhaustion:** Compares current pivot volume against the previous pivot to confirm a lack of counter-trend pressure.
* **RSI Extremes:** Filters signals based on Overbought/Oversold thresholds to increase probability.
* **Candle Confirmation:** Includes toggleable modes for **Basic** (engulfing/color) or **Pinbar** (rejection) confirmation before entry.
* **Advanced Risk Management:**
* **Dynamic Position Sizing:** Automatically calculates quantity based on a fixed risk % of equity and ATR-based stop loss.
* **Position Capping:** Includes a safety "cap" to prevent over-leveraging when volatility is low.
* **Trailing Stop:** Optional ATR-based trailing exit to capture extended trend runs.
* **Cooldown System:** Prevents over-trading by locking execution for a set number of bars after a trade.
**Best Used On:**
* **Pairs:** BTCUSDT.P, ETHUSDT.P, and major Altcoins.
* **Timeframes:** 1H or 4H for optimal signal-to-noise ratio.
**Overview**
This is a high-performance, trend-following strategy designed specifically for the Crypto market (e.g., BTCUSDT.P). It utilizes **Hidden Divergence** between Price and RSI to identify trend continuation opportunities with institutional-grade risk management.
**Key Technical Features:**
* **Zero Repaint Logic:** Implements `lookahead=barmerge.lookahead_off` and HTF candle offsets to ensure backtesting results match real-time execution.
* **Multi-Layered Filtering:**
* **Trend Filter:** Uses a Higher Timeframe (HTF) EMA 200 to ensure trades are only taken in the direction of the macro trend.
* **Volume Exhaustion:** Compares current pivot volume against the previous pivot to confirm a lack of counter-trend pressure.
* **RSI Extremes:** Filters signals based on Overbought/Oversold thresholds to increase probability.
* **Candle Confirmation:** Includes toggleable modes for **Basic** (engulfing/color) or **Pinbar** (rejection) confirmation before entry.
* **Advanced Risk Management:**
* **Dynamic Position Sizing:** Automatically calculates quantity based on a fixed risk % of equity and ATR-based stop loss.
* **Position Capping:** Includes a safety "cap" to prevent over-leveraging when volatility is low.
* **Trailing Stop:** Optional ATR-based trailing exit to capture extended trend runs.
* **Cooldown System:** Prevents over-trading by locking execution for a set number of bars after a trade.
**Best Used On:**
* **Pairs:** BTCUSDT.P, ETHUSDT.P, and major Altcoins.
* **Timeframes:** 1H or 4H for optimal signal-to-noise ratio.
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.
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.
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.