Indicators: Detection of the divergences

 

Detection of the divergences:

The lookup and display of the divergences of different classes based on the data of the base indicator.

Author: Ihor Herasko

 
sounds good.  but how to set ?
 
Lucy Demond:
sounds good.  but how to set ?
The installation process is described here - http://www.metatrader5.com/en/metaeditor/help/interface/toolbox/toolbox_codebase.
 

Privet Ihor,

I would like to set this indicator for RSI , What do I have to do ?

 

Change base indicator to "RSI" 

Set First calculation period to 70

Set Second calculation period to 30

 and left the 3rd one "1"

 is that all ?

 

And one more thing can I use this indicator for autotrading ?

 

thanks 

 
falanfilan:

Privet Ihor,

Hi, Falanfilan.

 

I would like to set this indicator for RSI , What do I have to do ?

 

Change base indicator to "RSI" 

Set First calculation period to 70

Set Second calculation period to 30

 and left the 3rd one "1"

 is that all ?

Yes. You describe the correct algorihm.

And one more thing can I use this indicator for autotrading ?

 

thanks 

There is no such indicator, which could make automated trading. This will require the development of the EA. By the way, such EA already developed by me. 
 
Where is the link for the download of this ondocator
 
dates2:
Where is the link for the download of this ondocator

On a page that contains a full description of the indicator - https://www.mql5.com/en/code/13784

Detection of the divergences
Detection of the divergences
  • votes: 23
  • 2015.12.10
  • Ihor Herasko
  • www.mql5.com
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 classes 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...
 

hi thanks for the awsome indicator

i want to use your indicator in an expert using iCustom function

i know you made an expert based on this indicator

the thing im asking  is this ... i  have set the setting for rsi divergences now i want to use the bearish and bullish  divergence signals in an expert using iCustom function.. could you guide me on how can i do it?

 
Farvardin Faili:

i want to use your indicator in an expert using iCustom function

Indicator has no buffers, therefore iCustom function is useless.

i know you made an expert based on this indicator

Yes, EA Divergence

the thing im asking  is this ... i  have set the setting for rsi divergences now i want to use the bearish and bullish  divergence signals in an expert using iCustom function.. could you guide me on how can i do it?

You can using the CDivergence class, located in Divergence_CalculateSignal.mqh file. For this:

  1. Declare a type variable CDivergence

CDivergence       m_divergence;

     2. Initialize this variable in constructor of your trade class

m_divergence(_Symbol,PERIOD_CURRENT,indicatorType,divergenceDepth,barsPeriod1,barsPeriod2,barsPeriod3,indAppliedPrice,indMAMethod,
                     findExtInterval,marketAppliedPrice,customName,customBuffer,customParamCnt,customParam1,customParam2,customParam3,
                     customParam4,customParam5,customParam6,customParam7,customParam8,customParam9,customParam10,customParam11,customParam12,
                     customParam13,customParam14,customParam15,customParam16,customParam17,customParam18,customParam19,customParam20,
                     coincidenceCharts,excludeOverlaps,useClassA,clrNONE,clrNONE,useClassB,clrNONE,clrNONE,useClassC,clrNONE,clrNONE,useHidden,
                     clrNONE,clrNONE,1)

     3. Process every tick

DivergenceData divData;
m_divergence.ProcessTick(divData);

Information about divergence will be in structure divData. If there is no divergence, then "type" field contains DIV_TYPE_NONE. If divergence is registered, then field contains value DIV_TYPE_BULLISH or DIV_TYPE_BEARISH. More information about registered divergence is in fields "regTime", "extremePrice", "divClass".

 

i included the file

but when i do the first step

CDivergence       m_divergence;

it gives this error:  'CDivergence' - wrong parameters count

thank you in advance

 
Farvardin Faili:

i included the file

but when i do the first step

it gives this error:  'CDivergence' - wrong parameters count

thank you in advance

The declaration needs to be done exactly inside the your class. 

Otherwise, you need to declare a pointer and create an instance of the class during program execution:

CDivergence *g_pClassDivergence;


int OnInit()
{
...
   if (CheckPointer(g_pClassDivergence) == POINTER_INVALID)
      g_pClassDivergence = new CDivergence(...);
...
}

void OnDeinit()
{
...
   if (CheckPointer(g_pClassDivergence) != POINTER_INVALID)
      delete g_pClasDivergence;
...
}