how to prevent sending alert continuously

 

Hi

My expert shows the name of symbol when ADX intersection as alert.

I would like to receive for every symbol just one time per day not more.

I have written an expert and I receive a lot of alerts continuously per second for every symbol. I want to put a condition to check if the symbol showed once do not alert it until I reopen my mql

thanks for your attention

 
mohsen alamdar :

Hi

My expert shows the name of symbol when ADX intersection as alert.

I would like to receive for every symbol just one time per day not more.

I have written an expert and I receive a lot of alerts continuously per second for every symbol. I want to put a condition to check if the symbol showed once do not alert it until I reopen my mql

thanks for your attention

You need to declare a variable of the 'datetime' type at the global program level (in the expert header) - as soon as a signal appears, you write the opening time of bar # 0 from the D1 timeframe to this variable.

If a new signal appears - you compare the time in the variable and the opening time of bar # 0 from the D1 timeframe.


Example in code ADX Extremum Alert

Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Position Properties
Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Position Properties
  • www.mql5.com
Position ticket. Unique number assigned to each newly opened position. It usually matches the ticket of an order used to open the position except when the ticket is changed as a result of service operations on the server, for example, when charging swaps with position re-opening. To find an order used to open a position, apply the...
 
Vladimir Karputov:

You need to declare a variable of the 'datetime' type at the global program level (in the expert header) - as soon as a signal appears, you write the opening time of bar # 0 from the D1 timeframe to this variable.

If a new signal appears - you compare the time in the variable and the opening time of bar # 0 from the D1 timeframe.


Example in code ADX Extremum Alert

Thanks a lot ***
 
mohsen alamdar :
Thanks a lot ***

Communicate culturally. Next time I'll send it to the ban.