Download MetaTrader 5

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

To add comments, please log in or register
MQL5 Cloud Network speeds up calculations. Try it!
BBSurferZA
37
BBSurferZA 2016.04.08 06:58 

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

Stuart Browne
5812
Stuart Browne 2016.04.08 10:38  
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
BBSurferZA
37
BBSurferZA 2016.04.08 13:49  
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.

Stuart Browne
5812
Stuart Browne 2016.04.08 13:56  
BBSurferZA:

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


Have a good w/end.

Welcome mate, you too :D
To add comments, please log in or register