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.
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน