Indicator: variable not defined

 

Hello,

I'm writing an indicator and have defined a variable 'BarsToProcess'.

However, on line 63 and 64, when compiling, I receive the message that this variable 'BarsToProcess' is not defined. I tried to define again, but then I receive message that it is already defined ...

I attach the mq4 file in txt format 'randomIndicator.txt' so you can read it.

Thank you for your comments. 

Files:
 
zeno1:

Hello,

I'm writing an indicator and have defined a variable 'BarsToProcess'.

However, on line 63 and 64, when compiling, I receive the message that this variable 'BarsToProcess' is not defined. I tried to define again, but then I receive message that it is already defined ...

I attach the mq4 file in txt format 'randomIndicator.txt' so you can read it.

Thank you for your comments. 

You declared this . .  .

extern int       BarsToProcess=100;

 and tried to use this . . .

   if(limit > barsToProcess)   // barsToProcess: variable not defined
      limit = barsToProcess;

 They are not the same variable.

 
zeno1:

Hello,

I'm writing an indicator and have defined a variable 'BarsToProcess'.

However, on line 63 and 64, when compiling, I receive the message that this variable 'BarsToProcess' is not defined. I tried to define again, but then I receive message that it is already defined ...

I attach the mq4 file in txt format 'randomIndicator.txt' so you can read it.

Thank you for your comments. 

Case sensitive : BarsToProcess vs barsToProcess. Anyway, .mq4 file can also be opened with notepad and .txt file can be opened with MetaEditor.
Reason: