Download MetaTrader 5
To add comments, please log in or register
Does your signal already have a lot of of subscribers? It's time to think about the paid subscription!
JB 2015.02.13 01:06 

I have this custom indicator that creates an alert / push notification when CCI crosses either -100 or 100. 

The problem is it keeps going off every time it bounces around the 100 mark...very annoying.

I wanted to try and add a delay something like this to the attached indicator:

bool AlertDelay() {
   static datetime last_time;
   if (TimeCurrent()-last_time<30) {    // delay for 30 seconds
   } else {

And then simply check AlertDelay()'s return before using Alert() like so:

if (AlertDelay()) Alert("Whatever...");


Will that work?  How do I add it to this indicator?

To add comments, please log in or register