SendNotificcation one per Period

Back to topics list To post a new topic, please log in or register
avatar
7
marky_74 2013.01.30 10:16
 

Hi guys,

 I have indicator sending notifications.

 I want to limit sending notifications to one or "n" per Period set on chart. 

Do you have any idea how to limit it?

Thanks for help in advance. 

 
avatar
14167
RaptorUK 2013.01.30 10:21 #
 
marky_74:

Hi guys,

 I have indicator sending notifications.

 I want to limit sending notifications to one or "n" per Period set on chart. 

Do you have any idea how to limit it?

Yes,  use the Search in the top right corner of this page . . .  try once per bar

 mql4 Search 

 
avatar
1
dombo 2015.04.13 18:43 #
 
marky_74:

Hi guys,

 I have indicator sending notifications.

 I want to limit sending notifications to one or "n" per Period set on chart. 

Do you have any idea how to limit it?

Thanks for help in advance. 

Hello I have the same issue. After the signal notifications are shooting me. Did you get a solution how to use only the first signal or limit them??
avatar
12995
WHRoeder 2015.04.13 20:00 #
 
dombo: Did you get a solution how to use only the first signal or limit them??
angevoyageur: I recommend to all not answer such thing that "use google or use this and you will have found this", it's absolutely not useful. Ignore it.
Ignoring post per https://forum.mql4.com/67034/page2#1010252
avatar
Moderator
3416
GumRai 2015.04.14 00:49 #
 
dombo:
Hello I have the same issue. After the signal notifications are shooting me. Did you get a solution how to use only the first signal or limit them??

I guess that you did try a search and that is how you found this old post.

It is relatively simple to do depending on how you want notifications limited by using a globally declared variable initially set to 0.

If you only want 1 notification per signal direction

If a buy signal, send notification and set the variable to 1 

If a sell signal, send notification and set the variable to -1 

When the code wants to send notification, check the value of the variable. If it is 1 don't send notifications for a buy signal.  If it is -1 don't send notifications for a sell signal.

 

If you only want 1 notification per bar, make the variable datetime

When sending the notification save the value of Time[0] in the variable

Only send notifications if Time[0]!=the variable. 

 

Back to topics list  

To add comments, please log in or register