Download MetaTrader 5
To add comments, please log in or register
Publish your article to let the traders see it in MetaTrader 5!
Cerberus
73
Cerberus 2014.05.06 16:07 
void OnTick()
  {
      double Middle = iBands(NULL,0,18,2,0,PRICE_CLOSE,MODE_MAIN,0);
      Alert("Middle =", Middle);

Please help with this code. I want it to give me an alert of what the middle of the bollinger band is at each tick. I know it's not practical, but the alert is just for testing the functionality of the whole program.

It gives me an alert as soon as I attach the EA, but never gives me an alert again.. Why?

Isn't it supposed to repeat this code each tick?

I'm using ME build 934

qjol
3243
qjol 2014.05.06 19:00  

works just fine for me

void OnTick()
   {
   double Middle = iBands(NULL,0,18,2,0,PRICE_CLOSE,MODE_MAIN,0);
   Alert("Middle =", Middle);
   }
Cerberus
73
Cerberus 2014.05.07 08:44  
Does it give you the Alert each tick?? It gives me one alert and then never again.
Keith Watford
Moderator
7959
Keith Watford 2014.05.07 09:06  
Cerberus:
Does it give you the Alert each tick?? It gives me one alert and then never again.


Check the rest of your code, look for endless loops or critical errors.

What do you see in the logs?

onewithzachy
2274
onewithzachy 2014.05.07 09:17  
Cerberus:
Does it give you the Alert each tick?? It gives me one alert and then never again.

Attach your EA again, select "common" tab, and select "Enable alert.", and then de-select "Disable alert once hit".


/
To add comments, please log in or register