Download MetaTrader 5

Difference - indicators

To add comments, please log in or register
Format text in the messages editor. It is convenient!
sqbi
22
sqbi 2016.09.23 19:28 

Hi,

May I know why it is not working:

int start()                         
  {
   int i,                          
       Counted_bars;                

   Counted_bars=IndicatorCounted(); 
   i=Bars-Counted_bars-1;           
   while(i>=0)                      
     {     
      Buf_0[i] = ((Close(i) - Close(i+1)) / Close(i+1))*100;                                 
      i--;                          
     }
   return;             
Whereas this one one is working:
int start()                        
  {
   int i,                           
       Counted_bars;                

   Counted_bars=IndicatorCounted(); 
   i=Bars-Counted_bars-1;           
   while(i>=0)                   
     {
      
      if(Open[i]-Close[i+1]<0)
      Buf_1[i]=-0.1;
     else
      Buf_0[i]=-0.1;              
      i--;                          
     }

   return;                          
  }
Bernhard Schweigert
5672
Bernhard Schweigert 2016.09.24 12:33  
sqbi:

Hi,

May I know why it is not working:

missing "}" at the end?
To add comments, please log in or register