How to get notification when an Expert Advisor displays an error in "Experts" tab?

 

Hello,
I would like to receive a notification when any expert displays an error, example :

2023.09.05 03:14:25.344 FX Blue - TradeCopy Sender EURUSD,M15: cannot set millisecond timer (100)

or :

2023.09.05 10:25:50.553 XXXX MT4 V1 GBPUSD,M5: cannot set timer (5)

or

2023.09.05 10:26:42.584 'XXXX MT4 USDCAD,M15' requires active MQL5 account in Tools->Options->Community

or

2023.09.05 10:27:14.788 XXXX USDJPY,M15: global initialization failed

I would like to be notified on my phone, like I am already when a trade open/close. Thank you for your help.

 

Currently not possible via pure MQL because it does not have access to the log files directly.

The push notification would have to be send by the EA itself. If you have the source code, you could add it.

If not, them a possible option is to use a DLL to access the log files and read their content, but since they are cached by the MetaTrader terminal, there may be a delay to processing it in a timely fashion.

 

Thanks much for the answer, totally makes sense.

I can't modify the EAs, and there are a few.

Instead of the DLL, which I don't know, would it be possible to code something like (just to give a rough idea) :

grep "Error" error.log | mail email@gmail.com ?

Thanks much!

 
fxliving #:

Thanks much for the answer, totally makes sense.

I can't modify the EAs, and there are a few.

Instead of the DLL, which I don't know, would it be possible to code something like (just to give a rough idea) :

grep "Error" error.log | mail email@gmail.com ?

Thanks much!

Yes, but that would be via email and not a "push notification".

However, the same conditions apply about a possible delay due to the in memory caching of log output. You will have to test and see.

Also, your topic has been moved to the section: MQL4 and MetaTrader 4

 

Thanks much, I prefer a notification, but I would go with the easiest (still sending email from VPS does not seems simple...)

It is ok if there is a delay.

So I could do this in powershell? Any advice before I start the work? Thank you very much!

 
fxliving #: So I could do this in powershell? Any advice before I start the work? 

That is beyond the scope of this forum. You will have to do your own research on that.

 
Ok, I understand, thanks much for your help.