Download MetaTrader 5

++ HAS STOPPED WORKING

To add comments, please log in or register
Mom_markets1
88
Mom_markets1  

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  
   for(int i=limit; i>=0; i--)
      {
      int grount; // ?????
      grount++;
      BufferD[i]=grount;
      }
Mom_markets1
88
Mom_markets1  
qjol:


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

Or maybe MetaEditor is the old version?
qjol
3243
qjol  

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
2584
Ian Venner  

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  

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