Download MetaTrader 5
To add comments, please log in or register
MQL5 Cloud Network is a distributed computing network. Just give it a try!
Marky
27
Marky 2013.01.30 09: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. 

Simon Gniadkowski
Moderator
17963
Simon Gniadkowski 2013.01.30 09: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 

dombo
5
dombo 2015.04.13 16: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??
whroeder1
13600
whroeder1 2015.04.13 18: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://www.mql5.com/en/forum/155059/page2#1010252
Keith Watford
Moderator
7887
Keith Watford 2015.04.13 22: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. 

/
To add comments, please log in or register