Double divergence scanner indicator

27 April 2018, 10:03
Jan Flodin
2
2 955

The main purpose of this blog is to describe and explain the input parameters of my Double divergence scanner indicator (MT4 version / MT5 version).

Please also check out my other divergence products for MT4:
Divergence indicatorDivergence scannerDivergence dashboardDivergence Expert Advisor (free)

For MT5:
Divergence indicatorDivergence dashboardDivergence Expert Advisor (free)


Input parameters

Parameters marked with an asterisk (*) in the beginning are only available in the MT5 version and parameters marked with two asterisks (**) in the beginning are only available in the MT4 version.
  • GENERAL SETTINGS
    • Scanning interval in secondsDefault is 1. Can be set to a higher value in order to prevent possible performance issues on slower computers.
    • Panel width: Default is 200. For instance, if you are using a non-standard font size in windows, you could set this to a larger value in order for the whole text to be visible.
    • Custom panel titleIf you put some text here this text will be shown instead of the default panel title.
    • Template name: The template you put here will be applied to the chart which will be opened when you click on a signal in the panel. The name must include the file extension (.tpl). The purpose of this parameter is to make it easier for quick desicion if to take the trade or not. Or if to wait for real reversal confirmation. Typically you would then use your own template which for instance could contain a support/resistance indicator and my free Multi oscillator divergence indicator, which will be necessary in order to see the divergence lines and arrows: 
      For Metatrader 4: https://www.mql5.com/en/market/product/68510
      For Metatrader 5:   https://www.mql5.com/en/market/product/68509
      You will be able to download the instructions how to create a chart template in the end of this blog.
    • Code page to use for extended unicode characters in symbol names - Here you have the the possibility to set a custom code page to support unicode extended characters (pound sign etc.) in symbol names. Usually the code page 1252 will do the trick.
    • Single chart mode: When set to True the indicator will scan for divergences only on the chart where it has been installed. It will only draw future divergences and it will not redraw patterns when changing time frame.
    • Delay in seconds for applying chart template: This parameter can be set to a higher value in case objects from other indicators or an Expert Advisor are now drawn on the chart.
  • SIGNAL SETTINGS
    • Amount of signals to show in the panel: Default is 20. But you can set it to more if it will fit on your chart. The signals will be shown in descending order, i.e. the latest signal first. The panel can be moved around on the chart by dragging it with the top list. It can also be minimized. If closing it with the x button the indicator will be unloaded from the chart as well. The panel does not support having font size set to for instance 125% in Windows. You can set the last (XX) signals in the indicator settings. You can change it to for instance 25. The panel height will then increase and in some cases it might not fit on your chart. To disable to panel you must set the value to 0.  
      The text on each row contains information about time (server time) when the alert was generated, divergence type, symbol, time frame and if bull or bear. For instance "3.5 18:00-R-USDJPY-H4-Bear". The time is written in the format M.D hh:MM. When clicking on a row a new chart will be opened with the selected symbol and time frame. The opened chart will be opened with the chart template which you have defined in the indicator settings.
    • Write signalsDrop down menu with the following selections:
      • File in data folder: Will save the signals to a .CSV file. The file is located in the \MQL4\Files folder (MQL5 in Metatrader 5) and the name of the file is "DDS_symbol_timeframe.csv". For instance "DDS_EURUSD_M5.csv". This file could be used by an Expert Advisor for automatical trading. The format in the file is: [divergence type (R or H)];[symbol name];[time frame (text)];[date of last extremum candle];[Bull or Bear]. For example "R;EURUSD;M30;6.11.2019  12:30:00;Bear". Always separated by a semi colon.
      • File in common folder: The file is stored in the common folder instead which is a folder shared by all Metatrader instances installed on the machine.
      • Write to globals: Will write the signals as global variables. Can also be used by an Expert Advisor for automatical trading. The format global variable name is "DDS-[symbol]-[type of divergence]-[time frame]-[bullish or bearish]. For instance "DDS-AUDUSD-H1-Bull-H" or "DDS-DE40-M5-Bear-R". H stands for hidden divergence and R for regular (classical) divergence. The value of the global variable is the time (in MQL5 format) of the trigger candle. 
    • Amount of signals to save in file: When this value has been reached then older signals will be deleted.
  • GENERAL DIVERGENCE SETTINGS
    • Use old logic (before version x.x): True or False. Set to true to detect divergences the way it was before version 2.5 (* 2.1). The new logic will detect more divergences but it will also come with a performance cost. Something which will be more visible on slower computers. The new logic will allow divergences even if there are additional indicator extremums (top/bottoms) between the 2 already existing extremum points.
    • Main indicator
    • Second indicator (double divergence)
    • Third indicator (triple divergence)
    • Enable single divergence (any of the 3 above): By setting this to True you will be alerted if any of the divergences enabled (in the 3 previous parameters) above will occur. Please note though that the text in the panel will not contain information about the divergence indicator in question. This will be clear when you open a chart by clicking in a signal in the panel and have properly prepared a chart template with my free divergence indicator.
    • Divergence candle shift: Set to 2 (default value ) or higher for a stronger confirmation of the possible reversal/trend continuation (confirmed divergence). By having it set to 1 you will catch the possible movement earlier (unconfirmed/pending divergence). On the other hand, the signal is less reliable. You can also set it to 0 for catching "early" divergences. This means that the alert will come directly upon candle open instead of waiting for the slope in the indicator to change direction (candle shift 1 or 2), which means that the price must show at least some sign of reversal. Please be aware though that this will lead to more false signals.
    • Divergence on candle shifts <= shift above: If set to True then the also divergences newer (lower candle shift) then the setting above will be valid. Please note that in this case also unconfirmed divergences will be searched for. This setting will not be used if Divergence candle shift has been set to 0 or 1.
    • Time frame for second/third divergence: The default value is 'current'.
    • One time frame higher: By setting it to True you will get alerts only when there is a second/third divergence on one time frame higher than the main divergence. Please note that if you get a main divergence signal on for instance M30, and the type of divergence is regular, the divergence on H1, if found, could be of both regular or hidden type.
    • Bars to check (divergence depth): Default is 40.
  • SCANNING FILTERS
    • Scan for bullish divergences: True or False.
    • Scan for bearish divergences: True or False.
    • Scan for hidden divergences: True or False.
    • Scan for regular divergences: True or False
  • MACD and OsMA SETTINGS:
    • Fast EMA: Default is 12.
    • Slow EMA: Default is 26.
    • Signal SMA: Default is 9.
  • ** AWESOME SETTINGS
    • Fast MA: Default is 5.
    • Slow MA: Default is 34.
  • Stochastic settings:
    • K: Default is 12.
    • D: Default is 3.
    • Slowing: Default is 3.
    • Apply to price
  • RSI period
  • CCI period
  • ATR period
  • MFI period
  • Momentum period
  • ADX AND OBV/MFI SETTINGS
    • ADX period
    • ADX line mode
    • * OBV/MFI volume type for calculation: List box from where you can select from Tick volume or Real volume.
  • COMPOSITE INDEX SETTINGS
    • RSI slow period
    • RSI fast period
    • Momentum period
    • Average period 1
    • Average period 2
    • Average period 3
    • Price type
    • Trend filter to use: Drop down menu with the following selections:
      • RSI
      • Bollinger bands
      • Stochastics
    • Enable trend filter for regular divergences
    • Enable trend filter for hidden divergences
    • RSI filter method for regular: Select whether to use the filter on the first, second or both extremum candles.
    • RSI filter method for hidden: Select whether to use the filter on the first, second or both extremum candles.
    • RSI overbought and oversold levels for regular and for hidden divergences (4 parameters): The divergence candle must form above/below these levels in order to be valid.
    • Stochastics overbought level
    • Stochastics oversold level
    • Bollinger shift
    • Bollinger deviation
    • ** Use close price instead of high/low: true or false.
    • Period: Period for the trend filter. RSI, Bollinger or Stochastics. If you use Bollinger and would like to use its default period then it should be set to 20.
    • Apply to price (RSI and Bollinger)
    • Trend time frame (current=main divergence time frame): You can set this for to instance the Daily (D1) time frame. In that case all scanned time frames will check RSI only on the D1 time frame.
    • MOVING AVERAGE (MA) FILTER SETTINGS
      • Enable MA: true or false.
      • MA period
      • MA shift
      • MA method
      • MA price type
      • Use divergence time frame: The same time frame as the currently scanned time frame will be used.
      • MA time frame (if set to false above): Will use this time frame regardless of which time frame is currently scanned.
    • Symbols to scan: Here you will put all symbols you would like to monitor. Every symbol must be entered in the exact way as it is visible in the Market Watch window and separated with a comma, without spaces. By design in Metatrader 4 the amount of character in a text (string) parameter is limited to 255. You can put more characters in the Symbols parameter but when reading the value, Metatrader cuts at 255. 255 characters will allow for 36 symbols and 35 commas (,) if the symbol length is 6 characters. If you need more symbols you can always drag the indicator with the remaining symbols to another chart. To come around this limitation you can set the value in the 'Use symbols from Market Watch window instead' parameter below to  true. By doing this the indicator will use the symbols visible in your Market Watch window instead.
    • Use symbols from Market Watch window instead: With this option set to true all visible symbols in your Market Watch window will be scanned instead of the symbols above. Due to performace reasons It is not recommended to use more than 40 symbols.
    • Time frames: Set to true for each time frame you would like to monitor.
    • OBJECT SETTINGS
      • Panel background color
      • Panel text color
    • Alerts: Set to true for each alert type you would like to receive.
    • Custom alert text: Blank by default. The text you put here will be inserted at the end of the alert text.



    Share it with friends: