Download MetaTrader 5
To add comments, please log in or register
Do you need private account monitoring? The Signals will provide you one!
marksimmonds
18
marksimmonds 2015.11.09 04:30 

I must be going blind.... why does this code cause my MT4 platform to hang? I'm assuming an infinite loop.... but the code looks good to me.... please help....THanks!


#property indicator_chart_window

//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
{

int b=1;
   do
      {
       Alert(" b=",b);
       b=b++;
      }
   while(b<10);
     
     
return(0);

}

honest_knave
958
honest_knave 2015.11.09 07:33  

This is your problem:

b=b++;

 

It should be:

b++;

 

or

b=b+1;

 

or

b=++b;


or

b+=1;
/
To add comments, please log in or register