RSI Divergence Indicator for MT4 and MT5

TrueTL Relative Strength Index (RSI) Divergence indicator calculates the RSI values and finds regular and hidden divergences automatically. It can draw divergence lines on the price chart, in the indicator window, or both, with optional arrows, vertical lines, alerts, multi-timeframe calculation, and EA-ready signal buffers.

Confirmed divergence signals do not repaint (more info). Confirmed arrows are drawn only after the signal candle has closed and the divergence is confirmed. Predicted divergence is different: it is an early warning mode, and predicted signals can disappear if the setup does not confirm.

Key features:

  • Works in both MetaTrader 4 and MetaTrader 5.
  • Finds regular and hidden Relative Strength Index (RSI) divergences automatically.
  • Draws divergence lines on the main chart, in the RSI window, or both.
  • Confirmed divergence signals do not repaint after confirmation (more info).
  • Optional predicted divergence mode can warn earlier, before full confirmation. This is useful for early context, but the signal can disappear.
  • Calculates and plots RSI (or dynamic) with configurable calculation inputs.
  • Multi-timeframe support with selectable interpolation modes.
  • Works with normal candle charts, line charts, and offline charts such as Renko or block charts.
  • 5 configurable signal slots. Each slot has its own iCustom buffer, arrow colors, and alert timing.
  • Signal types include indicator direction/level events, trendline breakout, trendline approach, regular divergence, hidden divergence, and predicted divergence when supported by the selected indicator.
  • Alerts can be sent by popup, push notification, email, sound, Telegram, CSV file, and chart pictogram.
  • Force refresh and smart HTTP/cache modes help keep visual backtesting and repeated testing faster (more info).
  • Divergence filtering can be tightened with maximum distance, candle-body filtering, level filters, value tolerance, and sensitivity control (more info).
  • All drawing colors, line styles, arrow symbols, indicator line styles, and the show/hide button are controlled from the Inputs tab.

EA and iCustom usage:

The indicator is ready for Expert Advisor integration through iCustom(). The non-signal buffers return the calculated RSI line values. The signal buffers return the five user-configurable signal slots, so an EA can read only the events you select in the inputs.

Signal slots are independent. For example, Signal 1 can watch a divergence event, while Signal 2 and Signal 3 can watch different level, direction, breakout, or line events.

  • Buffer 0: RSI (or dynamic) value buffer.
  • Buffer 1: Signal 1 buffer. Returns 1 or -1 based on the selected Signal 1 setting.
  • Buffer 2: Signal 2 buffer. Returns 1 or -1 based on the selected Signal 2 setting.
  • Buffer 3: Signal 3 buffer. Returns 1 or -1 based on the selected Signal 3 setting.
  • Buffer 4: Signal 4 buffer. Returns 1 or -1 based on the selected Signal 4 setting.
  • Buffer 5: Signal 5 buffer. Returns 1 or -1 based on the selected Signal 5 setting.

RSI Divergence Indicator Settings Panel
RSI Divergence Indicator Settings Panel


Indicator Inputs

  • Version: shows the installed indicator version. If support asks for your version, this is the value to check.
  • Username (without spaces, case sensitive): enter the username you received after purchase. After the first successful activation, you can usually leave it unchanged in other instances (about our ex4 protection).
  • Auto refresh: controls when server-side divergence objects are refreshed. Available options are:
    Off
    On (auto refresh depending on the last closed bar)
    Force refresh (force refresh if chart scrolling) More info.
  • Smart HTTP request: controls how often the indicator sends calculation requests. Available options are:
    Off - HTTP request on every bar
    Estimate - skip if 99% sure no new objects (faster)
    Cache - build a cache file and reuse saved results if available (fastest)
    Cache reset - fully rebuild the cache file (this symbol + period + settings)
  • RSI period: sets this calculation parameter for the RSI formula. Default: 14
  • Applied price: selects the price series used by the indicator calculation.
  • RSI bar shift: shifts the indicator calculation by the selected number of bars. Most users should keep this at 0. Default: 0
  • RSI timeframe: selects the timeframe used for the RSI calculation. It can use the current chart timeframe, fixed timeframes, or relative lower/higher timeframe presets.
  • MTF on higher TF only: turns this option on or off. Default: false
  • MTF Interpolation mode: controls how values from another timeframe are placed on the current chart. Available options are:
    Off (step mode)
    Linear (average smoothing)
    Smooth (sine ease in-out)
    Weighted (closer bars have more weight)
    SMA (period = 2 × ratio)
  • Maximum bars to calculate: limits how many bars are calculated. A lower value can improve performance. A higher value gives more history. Default: 2000
  • Show in the indicator window: controls the label shown in the indicator window. Use Allow multiple instances if you want to run more than one copy on the same chart. Available options are:
    Only "TrueTL" (2 indicators doesn't work on same chart)
    Indicator name (2 indicators doesn't work on same chart)
    Indicator name + settings
    Indicator name + settings + values
    Indicator name + values (2 indicators doesn't work on same chart)
  • Allow multiple instances (separate settings string): allows several RSI Divergence indicators on the same chart by giving each instance its own settings identity.

Levels Settings

  • Show levels: shows or hides the indicator reference levels in the indicator window.
  • High level (overbought): sets the upper reference level, usually used as the overbought zone. Default: 80
  • Low level (oversold): sets the lower reference level, usually used as the oversold zone. Default: 20
  • Show middle level: adds the middle level between the high and low levels.
  • Color of indicator levels: sets the color of the indicator level lines.
  • Style and width of indicator levels: sets the style and width of the indicator level lines. Available options are:
    Solid (width 1-5)
    Dash (width 1)
    Dot (width 1)
    DashDot (width 1)
    DashDotDot (width 1)

Divergence Settings

  • Use line chart (close prices) for divergence: makes divergence detection use close prices instead of candle highs and lows. This is useful for line charts or when you want to ignore wick extremes.
  • Maximum divergence distance (bars): limits how far apart the two divergence points can be. Smaller values focus on recent structures. Larger values allow wider swings. Default: 300
  • Filter by candle body: removes weaker divergences when candle bodies conflict with the price-side divergence line.
  • Value filter: filters divergence by where the two indicator points are located relative to the configured levels (more info). Available options are:
    Show all divergences
    A: above/below high/low B: above/below high/low
    A: above/below high/low B: above/below middle
    A: above/below high/low B: all
    A: above/below middle B: above/below high/low
    A: above/below middle B: above/below middle
    A: above/below middle B: all
    A: all B: above/below high/low
    A: all B: above/below middle
  • Value tolerance: gives the Value filter a little extra room. A value of 0 applies the level rule exactly.
  • Detection sensitivity: controls how many divergence structures the indicator searches for.
  • Divergence prediction: enables early predicted divergence markers. Confirmed divergences do not repaint, but predicted markers can disappear if the candle closes without confirmation. Available options are:
    Off
    Same sensitivity as the divergence
    Highest sensitivity
  • Divergence showing mode: chooses which divergence objects remain visible. Available options are:
    Show all divergences
    Show only bullish divergences
    Show only bearish divergences
  • Draw divergence lines on price chart: draws divergence lines on the main price chart.
  • Draw divergence lines on RSI window: draws divergence lines in the RSI indicator window.
  • Draw objects in background: places drawn objects behind candles and other chart drawings.
  • Approach distance (RSI units): sets how close the indicator line must come to a drawn trendline before an approach signal can trigger. Default: 1.0
  • Bullish regular style/width (Off = hide): sets the style and width for this divergence line type. Off hides that type. Available options are:
    Off
    Solid (width 1-5)
    Dash (width 1)
    Dot (width 1)
    DashDot (width 1)
    DashDotDot (width 1)
  • Bullish regular divergence color: sets the color for this divergence line type.
  • Bullish hidden style/width (Off = hide): sets the style and width for this divergence line type. Off hides that type. Available options are:
    Off
    Solid (width 1-5)
    Dash (width 1)
    Dot (width 1)
    DashDot (width 1)
    DashDotDot (width 1)
  • Bullish hidden divergence color: sets the color for this divergence line type.
  • Bearish regular style/width (Off = hide): sets the style and width for this divergence line type. Off hides that type. Available options are:
    Off
    Solid (width 1-5)
    Dash (width 1)
    Dot (width 1)
    DashDot (width 1)
    DashDotDot (width 1)
  • Bearish regular divergence color: sets the color for this divergence line type.
  • Bearish hidden style/width (Off = hide): sets the style and width for this divergence line type. Off hides that type. Available options are:
    Off
    Solid (width 1-5)
    Dash (width 1)
    Dot (width 1)
    DashDot (width 1)
    DashDotDot (width 1)
  • Bearish hidden divergence color: sets the color for this divergence line type.
  • Filtered divergence color: sets the color for divergence objects detected outside the selected filter rules.
  • Predicted bullish divergence color (arrow and line): sets the arrow and line color used for predicted divergence markers.
  • Predicted bearish divergence color (arrow and line): sets the arrow and line color used for predicted divergence markers.
  • Status notification corner: sets where chart-side status messages are shown.

Signal Settings

  • Vertical line on/off and size/style: draws an optional vertical line on signal bars and controls its style and width. Available options are:
    Off
    Solid (width 1-5)
    Dot
    Dash
    Dash-Dot
    Dash-Dot-Dot
  • Arrow on/off and size: draws signal arrows on the main chart and controls their size. Available options are:
    Off
    Size 1-8
  • Arrow distance from candle: controls how far arrows are placed from candles. ATR-based distance adapts to volatility. Point-based distance uses fixed point values. Available options are:
    Close (1x ATR)
    Medium (2x ATR)
    Far (3x ATR)
    Close (20 points)
    Medium (50 points)
    Far (100 points)
  • Up arrow code (Wingdings): sets the Wingdings symbol for bullish/up signal arrows. Default: 233
  • Down arrow code (Wingdings): sets the Wingdings symbol for bearish/down signal arrows. Default: 234
  • Arrow symbol at predicted bullish divergence: sets the Wingdings symbol for predicted divergence markers. Default: 236
  • Arrow symbol at predicted bearish divergence: sets the Wingdings symbol for predicted divergence markers. Default: 238
  • Signal 1-5 Up color / Signal 1-5 Down color: assign separate bullish/up and bearish/down colors to each signal slot. This is useful when several signals are active at the same time.

Alert Settings

  • Alert on new divergences: sends an alert when a new regular or hidden divergence is detected. This works independently from the five signal slots.
  • Alert for Signal 1-5: sets alert timing separately for each signal slot. Available options are:
    Off
    After candle closed
    Before candle is closing
    Both
  • Trendline objects to alert for: selects which chart objects are monitored by trendline breakout and approach alerts. Available options are:
    TrueTL drawn trendlines only
    All trendlines and horizontal lines
    Selected trendline colors only
  • Trendline color filter (for ao_selected_colors): defines the monitored object color when alerts are set to selected colors.
  • Alert interval limit (minutes, 0=no limit): prevents repeated alerts from firing too often. 0 disables the interval limit.
  • Shortcut key to send test alert: lets you send a test alert from the chart with a keyboard shortcut. Available shortcut values are Off, 0-9, and A-Z.
  • Alert start time: sets the daily start time for alerts. 00:00 to 00:00 means alerts are allowed all day.
  • Alert end time: sets the daily end time for alerts. 00:00 to 00:00 means alerts are allowed all day.
  • Message identifier: adds a short label to alert messages. This is useful when several charts, symbols, or indicator instances are running.
  • Alert via email: enables this MetaTrader alert channel.
  • Alert via push notification: enables this MetaTrader alert channel.
  • Alert via popup window: enables this MetaTrader alert channel.
  • Alert with sound: enables this MetaTrader alert channel.
  • Sound file: selects the sound file used by sound alerts. Default: "Tick.wav"
  • Telegram Notifications: enables Telegram delivery.
  • Token: sets the Telegram bot token.
  • Chat ID: sets the destination Telegram chat ID.
  • Pictogram alert: shows a chart-corner symbol that changes with the latest alert direction.
  • Pictogram corner: sets the pictogram corner.
  • Pictogram X: sets the pictogram horizontal position. Default: 15
  • Pictogram Y: sets the pictogram vertical position. Default: 45
  • Pictogram size (font): sets the pictogram font size. Default: 24
  • Pictogram symbol (Wingdings code): sets the Wingdings symbol used by the pictogram alert. Default: 71
  • Pictogram UP color: sets the bullish/up pictogram color.
  • Pictogram DOWN color: sets the bearish/down pictogram color.
  • Pictogram neutral color: sets the neutral pictogram color.
  • Write alert to CSV file: writes alerts to a CSV file in the platform files folder for later review or external automation.

Color and Style Settings

  • Color mode: controls how the indicator line colors are selected. Available options are:
    Simple color
    Only direction
    Direction with levels
    Only levels
  • Draw Main line in histogram mode: displays the main line as a histogram instead of a line.
  • Color 1-4 of Main line: set the possible color states for the main line. The active color depends on the selected Color mode.
  • Style and width of Main line: selects the line style and width for the main line. Available options are:
    Solid (width 1-5)
    Dash (width 1)
    Dot (width 1)
    DashDot (width 1)
    DashDotDot (width 1)

Show/Hide Button Settings

  • Enable show/hide button: enables the chart button used to show or hide the indicator without removing it from the chart (more info).
  • Shortcut for button (0=disabled): controls the keyboard shortcut for the show/hide button. Available shortcut values are Off, 0-9, and A-Z.
  • Apply for all TrueTL Indicators on the chart: controls whether the button affects only this instance or all TrueTL indicators on the chart.
  • Adjust the corner of button: sets the button corner on the chart.
  • Adjust the text of button: sets the button caption. Default: "RSI DIV"
  • Adjust the text's font of button: sets the button font. Default: "Corbel"
  • Adjust the text's size of button: sets the button text size. Default: 9
  • Adjust the text's color of button: sets the button text color.
  • Adjust the background color of button: sets the button background color while visible.
  • Adjust the background color of button when hidden: sets the button background color while hidden.
  • Adjust the border color of button: sets the button border color.
  • Adjust the coordinate X of button: sets the button X coordinate. Default: 20
  • Adjust the coordinate Y of button: sets the button Y coordinate. Default: 40
  • Adjust the width of button: sets the button width. Default: 70
  • Adjust the height of button: sets the button height. Default: 20
  • Button DPI scale (auto = Windows DPI): controls the button size on different displays. DPI scale can be automatic or fixed. Available options are:
    Auto (Windows DPI)
    50%
    75%
    100%
    125%
    150%
    175%
    200%
RSI Divergence #1 RSI Divergence #2 RSI Divergence #3 RSI Divergence #4

Risk warning

Foreign exchange transactions carry a high degree of risk and any transaction involving currencies is exposed to, among other things, changes in a country's political condition, economic climate, acts of nature - all of which may substantially affect the price or availability of a given currency.

Speculative trading in the foreign exchange market is a challenging prospect with above average risk. You must therefore carefully consider your investment objectives, level of experience and appetite for such risk prior to entering this market. Most importantly, do not invest money that you are not in a position to lose.

In addition, trading on a margin basis means that any market movement will have a proportionate effect on your deposited funds. This can work for you as well as against you. The possibility exists that you could sustain a total loss of initial margin funds.

Risk Warning