please help me!

 
int start()

{
double ExtMapBuffer1[];
   SetIndexStyle(0,DRAW_LINE);

   SetIndexBuffer(0,ExtMapBuffer1);

MathSrand(TimeLocal());



    for(int i=0; i<Bars; i++)

   {

      ExtMapBuffer1[i]= MathRand()%1001;

   }

      return(0);

}

Hi friends, i'm starting to learn to program, i have a question from a exercise, based on this code above


I really tried to understand this for loop, but i can't,  on that  ExtMapBuffer1 [i], if i understood right, the very first cycle this value will be 0 , right? and this value somehow 

will  bind to some bar or candle, but why and to what candle?  because its not open[] close[] or anything, i compiled and it creates the indicator, but i dont know why it works, thanks for any 

help 

 
mrluck1: i'm starting to learn to program, i have a question from a exercise, based on this code above. I really tried to understand this for loop, but i can't,  on that  ExtMapBuffer1 [i], if i understood right, the very first cycle this value will be 0 , right? and this value somehow will  bind to some bar or candle, but why and to what candle?  because its not open[] close[] or anything, i compiled and it creates the indicator, but i dont know why it works, thanks for any

Have a look at the following:

However, you should read all the documentation on MQL4:

But pay special attention to the Updated form of MQL4 Language:

Also, have a look at the many examples of code available:

Also, given that you are from Brazil, if you have difficulty with the English language, consider going over to the:
Creation of Custom Indicators - Simple Programs in MQL4 - MQL4 Tutorial
Creation of Custom Indicators - Simple Programs in MQL4 - MQL4 Tutorial
  • book.mql4.com
Creation of Custom Indicators - Simple Programs in MQL4 - MQL4 Tutorial
Reason: