Download MetaTrader 5

Help fix errors in momentum candles indicator

To add comments, please log in or register
gutu
79
gutu  

Hello,


the below is failing to open. when i compile it it shows errors. Help clear the erros please

//+------------------------------------------------------------------+
//|                                             Momentum Candles.mq4 |
//|                                                              cja |
//+------------------------------------------------------------------+

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Lime
#property indicator_width1 3
#property indicator_width2 3

extern int candle.pipvalue = 10;

double buffer1[];
double buffer2[];


double myPoint;
   double SetPoint()
   { double mPoint;
   if (Digits < 4)
   mPoint = 0.01;
   else
   mPoint = 0.0001;
   return(mPoint);
   }

int init() {
   myPoint = SetPoint();
   IndicatorBuffers(2);
  
   SetIndexBuffer(0, buffer1);    
   SetIndexStyle(0, DRAW_HISTOGRAM);
  
   SetIndexBuffer(1, buffer2);    
   SetIndexStyle(1, DRAW_HISTOGRAM);
  
   IndicatorShortName("Momentum Candles");
      
   return(0);
}
 
int deinit() { return(0);}
    
int start() {
     
   int counted_bars=IndicatorCounted();
 
   if(counted_bars < 0)
       return(-1);
   if(counted_bars > 0)
       counted_bars--;
      
   int limit = Bars - counted_bars;    
     
   for(int i = limit; i >= 1; i--) {

      int shift = iBarShift(Symbol(), 0, Time[i], true);    
         
      buffer2[i] = 0;
      buffer1[i] = 0;     
         
      double close = iClose(Symbol(),0,shift);
      double open  = iOpen(Symbol(),0,shift);
        
      if(open > close && (open-close)>candle.pipvalue*myPoint) {
        
         buffer2[i] = close;     
         buffer1[i] = open; 
      }
      if(open < close && (close-open)>candle.pipvalue*myPoint) {
       
         buffer2[i] = close;
         buffer1[i] = open;     
          
      }
    }
   return(0);
 }


Carl Schreiber
6973
Carl Schreiber  

1) Please use the SRC for posting code... (beside the camera)!

2) Post as well the error code..

whroeder1
15321
whroeder1  
candyman752: it shows errors. Help clear the erros please

  1. Don't paste code
    Play video
    Please edit your post.
    For large amounts of code, attach it.

  2. What errors, on what line? There are no mind-readers here.
To add comments, please log in or register