Download MetaTrader 5

Get highest value from oscillator

To add comments, please log in or register
LANGAT NAFTALI
900
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.

  

more details here

Alain Verleyen
Moderator
33501
Alain Verleyen  
What have you tried ?
Kaleem Haider
142467
Kaleem Haider  
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
LANGAT NAFTALI
900
LANGAT NAFTALI  
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;
            }
       }
     
     }the actual indicator
To add comments, please log in or register