detection of the divergences

detection of the divergences
Download ALL MT4 indicators (1640)
YouTube Video Thumbnail



Similar MetaTrader Tools

detection of the divergences

Info

The detection of the divergences is a Indicator for MetaTrader 4 that the indicator displays divergences in the form of two matched lines: one on the price chart, the other — on the indicator chart. it allows to register four of divergences.

Usage

This tool is typically used for enhancing chart analysis and decision making.

Platform

This Indicator works exclusively on MetaTrader 4 (both build 600+ and newer versions).

Setup

Place the downloaded file in MQL4/Indicators folder via File ? Open Data Folder in MetaTrader 4.


How to Install and Use detection of the divergences

1. Installation: Place your file in the MQL/Indicators folder via "Open Data Folder" and restart your terminal.

2. Loading: Find the indicator in the Navigator, drag it onto your chart, and configure the input parameters in the popup window.

3. Customization: Press Ctrl+I to open the indicator list, select your tool, and click "Properties" to change colors, levels, or visual styles.

4. Updating: Replace the old file in the Indicators folder with the new version and restart the platform to apply changes.

Frequently Asked Questions

Q: Why is my indicator not showing? A: Verify the file is in the MQL/Indicators folder, or try right-clicking the "Indicators" tree in the Navigator and clicking "Refresh."

Q: Do custom indicators slow down the platform? A: Too many complex indicators can impact performance; remove unused ones via the "Indicator List" (Ctrl+I).

Q: Can I use MT4 indicators on MT5? A: No, MQL4 and MQL5 are distinct languages; ensure the indicator is compiled specifically for your platform version.

What this tool does

the indicator displays divergences in the form of two matched lines: one on the price chart, the other — on the indicator chart.

Typical Use Case

This Indicator excels in automated trading and technical analysis on MetaTrader 4.

Compatible Platform & Setup

This Indicator works on MetaTrader 4. Place the file in the MQL4/Indicators folder and restart the terminal.

Description & Settings

Related: inside bar indicator: reliable candlestick pattern detection - another powerful indicator for MetaTrader 4 traders.


Also recommended: Figurelli RSI: Enhanced Relative Strength Index for Trend Detection - similar indicator with strong performance on MetaTrader 4.

the indicator displays divergences in the form of two matched lines: one on the price chart, the other — on the indicator chart. it allows to register four of divergences. for each of the divergence class there is a switch to indicate the necessity of its registration, as well as the color selection of the bull and the bear divergence lines:
one of the six standard indicators included in the divergenceviewer (rsi, macd, momentum, rvi, stochastic, standard deviation) is used as an indicator that serves as data source for the lookup of the divergences with the price (in the indicator's terminology — the
base indicator
). the indicator can also operate with two non-standard indicators: derivative and william blau.
the parameters of the base indicator are set in the input parameter block with the same name:
the parameters should be set in the same order as they are presented in the standard indicator. for example, for the stochastic base indicator the accordance will be as follows:

"the first calculation period" — %k,

"the second calculation period" — %d,

"the third calculation period" — slowing.
if the number of the base indicator parameters is less than three, then the corresponding calculation periods are simply not displayed, and the values of these parameters are ignored. so, for the rsi and the momentum indicators it is sufficient to set the values of only two parameters: "the first calculation period" and "indicator calculation price".
if some other indicator needs to used as the base indicator, then choose the value "custom" in the "base indicator" parameter, and fill the following lines in the "custom indicator" block:

"indicator name" — the name of an indicator, which is present in the "navigator" window of the terminal. specified without the extension.

"index of the buffer for data pickup" — the index of the indicator line, values of which will be used for plotting the base indicator chart (most often — 0).

"number of the indicator parameters" — specify the amount of the input parameters used by the indicator. if set to 0, then the default parameter values will be used for the base indicator.

"value of the n-th parameter" — set the values of the corresponding parameters of the base indicator.
after setting up the base indicator it is necessary to determine the maximum length of the divergence by filling the "depth of the 2-nd support point lookup" parameter, and to define how much the price extremums must match the indicator extremums — the "from price extremum to indicator extremum" parameter.
the divergence registration is based on the local extremum lookup. to form any extremum at least three bars are needed, the central of which is the extremum. for that reason, the registration of the divergences is made with a two bar delay. the figure shows the class a divergences and bars marked with vertical lines (not part of the indicator), which show the divergence registration places.
the full description of the indicator capabilities and its formation logic is available in the "" article.

You may also like: doji candle detection - excellent alternative for indicator users on MetaTrader 4.

Source Code

#property copyright "robotfx"
#property link "https://robotfx.org"
#property description "this code is educational. feel free to use, modify and upgrade as you wish. visit robotfx.org for professional trading tools"
#property version "1.18"
#property strict
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1  clrdodgerblue
#property indicator_level1 0.0
enum enum_yesno

.......

Leave your opinion, ask a question, share some knowledge

Limitations & Risk Warning

  • This tool is provided for educational and testing purposes only.
  • Past performance does not guarantee future results.
  • Trading involves substantial risk of loss. Use on a demo account first.
  • Results may vary depending on market conditions, broker, and settings.
  • We recommend thorough backtesting and forward testing before using with real funds.
© ROBOTFX Free educational tools by RobotFX. Use entirely at your own risk; we are not liable for any financial losses incurred.