# Get highest value from oscillator

2575

Am wondering how to get the highest value (Amplitude)  of any oscillator like MACD for:

• the unformed next 10  bars or from
•  the inter-fall it crosses line zero and goes down or line zero up until the opposite is true.

39020

What have you tried ?
359841

LANGAT NAFTALI:

Am wondering how to get the highest value (Amplitude)  of any oscillator like MACD for:

• the unformed next 10  bars or from
•  the inter-fall it crosses line zero and goes down or line zero up until the opposite is true.

Look for extremus on macd, same logic as zig zig but only tops. Try writing some codes using resources here at MQL. If you get stuck, share code, help will come
2575

Alain Verleyen:
What have you tried ?
/*****************************Trial one*****************************************************************************************************************/
double f4=iCustom(NULL,0,"Examples/my indicator",DogerBlue,4,0);//This is not Macd similar. Range can even go higher than 10 from picture below

double m=(f4<=opt && f4b>-0.00);//Crossing 0.0 line up
double n=(f4>=-opt && f4b<0.00);//crossing down

limit=rates_total-prev_calculated;
if(prev_calculated>0)
limit++;

for(int i=0; i<limit; i++)
{
if(f4>opt||f4<-opt)
{
for(int j=rates_total-1;j>=0;j--)
{
double j=ArrayMaximum(DexBuffer8[i],WHOLE_ARRAY,j);
DexBuffer8[i]=j;
}
}

}