ZA RSI Divergence
- Indicatori
- Versione: 1.0
RSI Divergence Line MT5 automatically detects Regular and Hidden RSI divergences and draws clean, synchronized straight line segments simultaneously on both the main price chart and the RSI sub-window. Instead of cluttered arrows, exact pivot-to-pivot line segments make market structure and momentum shifts easy to read at a glance.
Built with a strict non-repainting pivot confirmation engine and dedicated iCustom signal buffers, this indicator is designed for both manual traders and Expert Advisor (EA) developers.
=== Key Features ===
- Synchronized Straight-Line Plotting: Connects pivot highs and lows with crisp, non-extending line segments on both price (High/Low) and the RSI curve.
- Regular & Hidden Divergences: Supports Regular Bullish/Bearish divergences (reversal setups) and optional Hidden Bullish/Bearish divergences (trend continuation setups) with independent colors and line styles.
- Strict Non-Repainting Logic: Signals are locked only after the configured right-side confirmation bars close, ensuring historical display matches live chart behavior.
- Clean Modern Visuals: Customizable RSI line, optional shaded Overbought/Oversold zone (30-70), and dashed level lines suitable for both dark and light chart themes.
- Smart Divergence Filters: Fine-tune detection using Left/Right pivot strength, Min/Max bar distance between pivots, and an optional OB/OS filter requiring the initial pivot to form in overbought or oversold territory.
- Real-Time Notifications: Built-in MetaTrader 5 popup alerts and mobile push notifications upon divergence confirmation (automatically disabled during Strategy Tester runs).
- EA-Ready (iCustom Buffers): Exports dedicated non-repainting Buy/Sell signal buffers stamped directly at the confirmation bar (bar 1 on close) and automatically skips chart object drawing in non-visual Strategy Tester mode for fast backtesting.
=== Input Parameters ===
RSI Settings:
- RSI Period: Calculation period for the RSI (default: 14).
- Applied Price: Price source used for RSI calculation (default: Close).
- Overbought / Oversold Level: Upper and lower threshold levels (default: 70 / 30).
- RSI Line Color & Width: Visual styling for the RSI curve.
- Show OB/OS Shaded Zone & Colors: Toggle and customize the background fill between OB and OS levels.
Divergence Detection:
- Pivot Lookback Left / Right: Number of bars to the left and right required to confirm a pivot point (default: 5 / 5).
- Min / Max Distance Between Pivots: Minimum and maximum bar range allowed between two compared pivots (default: 5 / 60).
- Max Historical Bars to Scan: Limits historical scanning depth for optimal chart performance.
- Show Regular / Hidden Divergence: Independently enable or disable Regular and Hidden divergence detection.
- Filter First Pivot in OB/OS Zone: When enabled, Regular Bearish requires the first pivot >= Overbought and Regular Bullish requires the first pivot <= Oversold.
Divergence Lines & Alerts:
- Custom colors, line width, and styles (Solid, Dot, Dash) for Regular and Hidden divergences.
- Enable Popup Alert / Enable Mobile Push Notification: Toggle real-time alerts.
=== Buffer Reference (For EA Integration via iCustom) ===
Signals are written strictly at the confirmation bar (shift = 1 when the confirmation bar closes):
- Buffer 2: RSI Value (0.0 to 100.0)
- Buffer 3 (Buy Signal): 0.0 = No Signal | 1.0 = Regular Bullish Divergence | 2.0 = Hidden Bullish Divergence
- Buffer 4 (Sell Signal): 0.0 = No Signal | 1.0 = Regular Bearish Divergence | 2.0 = Hidden Bearish Divergence
=== Disclaimer ===
Technical indicators are analytical tools intended to assist with chart analysis and do not guarantee future trading results. Always combine indicator signals with proper risk management and market structure confirmation.
