Download MetaTrader 5
To add comments, please log in or register
Order a robot or an indicator for MetaTrader. The Freelance service will help you!
Mom_markets1
88
Mom_markets1 2014.03.26 03:30 

here is a sample indicator. you can see that ++ does not work. the buffer should rise one integer for every bar over time.

Files:
test.mq4 3 kb
qjol
3243
qjol 2014.03.26 03:34  
   for(int i=limit; i>=0; i--)
      {
      int grount; // ?????
      grount++;
      BufferD[i]=grount;
      }
Mom_markets1
88
Mom_markets1 2014.03.26 03:44  
qjol:


There must be something wrong with my computer
SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.03.26 03:51  
Mom_markets:
There must be something wrong with my computer

Or maybe MetaEditor is the old version?
qjol
3243
qjol 2014.03.26 03:54  

nothing is wrong with the computer

it's the code

for(int i=limit; i>=0; i--)
{
int grount; // this line doesn't belong here put it outside the start section or make it static
grount++;
BufferD[i]=grount;
}

Ian Venner
2583
Ian Venner 2014.03.26 04:01  

or just put it outside the for loop. You should also initialize it. Latest version mql4 requires variables to be initialized before they are used.

Mom_markets1
88
Mom_markets1 2014.03.26 05:00  

ok, that worked. now to change every indicator i ever made. not such a good update. I have been very impressed that I have not had to do this more often. thanks for the help!

1

/
To add comments, please log in or register