.

Please help me with DSS Bressert - any nrp alerts - divergence 2.03.mq4

#1
Dear mntiwana,

I'm trying to make this wonderful indicator to discover bigger and more divergences from let say last closed bar to 20 closed bars.
I thought adding the following line:
extern int bars_to_scan = 20 ;

and replacing 5 with bars_to_scan in below lines:

int GetIndicatorLastPeak(int shift)
{
for (int i = shift+ bars_to_scan; i < Bars; i++)
{
if(dssBuffer >= dssBuffer[i+1] && dssBuffer > dssBuffer[i+2] && dssBuffer >= dssBuffer[i-1] && dssBuffer > dssBuffer[i-2])
return(i);
}
return(-1);
}

int GetIndicatorLastLow(int shift)
{
for (int i = shift+ bars_to_scan; i < Bars; i++)
{
if (dssBuffer <= dssBuffer[i+1] && dssBuffer < dssBuffer[i+2] && dssBuffer <= dssBuffer[i-1] && dssBuffer < dssBuffer[i-2])
return(i);
}
return(-1);
}


will do the job , but now the indicator only discovering larger divergences and not showing the other smaller ones.

Could you please help to make the indicator showing all divergences from 2-20 bars?

Thanks in advance,
DSS Bressert - any nrp alerts - divergence 2.03.mq4
(18.78 KiB) Downloaded 12 times


Attachments 1
  1. Similar Topics

    1. Rsi alert divergence inaccurate

      10 Replies 956 Views

      by Rdr, Fri Nov 16, 2018 5:40 pm in MT4 Indicators

      10 Replies
      956 Views
    2. Volume divergence indicator

      5 Replies 3051 Views

      by Hamur, Thu Oct 11, 2018 4:10 am in MT4 Indicators

      5 Replies
      3051 Views

Return to “Coding Help”

Who is online

Users browsing this forum: CommonCrawl [Bot] and 0 guests