EA fires off alert to terminal every second - How do I change the alert duration?

 

Hi guys,


Love this forum...infinite collaboration of talent and information !

I have created an EA which fires off an alert to the MT4 terminal, however it happens every second.

Where should I got to learn on how to change my alert from every second and be able to set it too every 4 seconds for example? (Please appreciate I am not a developer so take a wee longer to get on top of this)

Snippet of my alert code where I think I would add a function which tells me if Alert = true send only every 4seconds of sorts?.


 bool HammerCallmainresult = HammerCallMain(abc, abd, abe, abf, abg, abh, abi);
  
       if (HammerCallmainresult)
         {
              Alert("CALL5minHammer", Period(),"",Symbol());
            

         }

Any help would be appreciated and kind thanks,


BBSurfer

 
BBSurferZA:

Hi guys,


Love this forum...infinite collaboration of talent and information !

I have created an EA which fires off an alert to the MT4 terminal, however it happens every second.

Where should I got to learn on how to change my alert from every second and be able to set it too every 4 seconds for example? (Please appreciate I am not a developer so take a wee longer to get on top of this)

Snippet of my alert code where I think I would add a function which tells me if Alert = true send only every 4seconds of sorts?.

 

 

You need to change the EventSetTimer call from 1 to 4 eg EventSetTimer(4). It will usually be located in your Init() function. Or if it's a millisecond timer, from 1000 to 4000. See here or here 

EventSetTimer - Working with Events - MQL4 Reference
EventSetTimer - Working with Events - MQL4 Reference
  • docs.mql4.com
EventSetTimer - Working with Events - MQL4 Reference
 
Stuart Browne:

 

You need to change the EventSetTimer call from 1 to 4 eg EventSetTimer(4). It will usually be located in your Init() function. Or if it's a millisecond timer, from 1000 to 4000. See here or here 

Kind thanks Stuart...Will read up and see if I can implement.


Have a good w/end.

 
BBSurferZA:

Kind thanks Stuart...Will read up and see if I can implement.


Have a good w/end.

Welcome mate, you too :D