Download MetaTrader 5

Code not repeating at a tick

To add comments, please log in or register
Cerberus
73
Cerberus  
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  

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  
Does it give you the Alert each tick?? It gives me one alert and then never again.
Keith Watford
Moderator
9980
Keith Watford  
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
2271
onewithzachy  
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