Download MetaTrader 5

Get highest value from oscillator

To add comments, please log in or register
Post web links to other trader's signals and make profit
LANGAT NAFTALI
625
LANGAT NAFTALI 2016.01.28 23:41 

   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
30755
Alain Verleyen 2016.01.29 08:14  
What have you tried ?
Kaleem Haider
75268
Kaleem Haider 2016.01.29 16:39  
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
625
LANGAT NAFTALI 2016.01.29 19:24  
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