WatchDog - EA monitoring script. - MetaTrader 4 Scripts - MT4/MT5 Resources
WatchDog is an Expert Advisor and System monitoring script.
WatchDog sends emails when there is a problem, order opened or closed, requotes, log errors, server down... Just drag the script into the chart window.
In order to use this script you must:
Playbooks are event-based; each event defines a monitoring task. WatchDog comes with many predefined events. But it is also possible to add custom events. I'll explain how to do this later. There are basically two types of events: events and log events. Log events searches a given log file for a string. The difference between events and log-events is only the parameter count. Log events always require a log file name and search pattern.
Here is a brief description of all events. (Each event has its own event ID, which is defined in the source.)
Log events:
To change or add events, go to the init() function. Below the "Event Configuration" comment line, you can add or update event parameters.
Additionally, if you add events, you must uncomment or add the corresponding lines in the switch statement. Search for "custom1" in the script to see what I mean.
For example, to add a log event (WDE_JL_custom1) that searches the log for "error", just uncomment and update these lines.
// wd_eventTitle[WDE_JL_custom1] = "Custom1"; // Email subject // wdc[WDE_JL_custom1][WDC_ENABLED] = 1; // Event 0=disabled/1=enabled // wdc[WDE_JL_custom1][WDC_INTERVAL] = 60; // Check interval (in seconds) // wdc[WDE_JL_custom1][WDC_NORMALLEVEL] = 1; // If level-counter >= 1, perform normal operation // wdc[WDE_JL_custom1][WDC_NORMALACTION] = WDA_MAIL|WDA_RESET; // Normal operation: send mail and clear level counter // wd_logPath[WDE_JL_custom1] = BASEDIR+"logs\\"; // Log path // wd_match1[WDE_JL_custom1] = "Error"; // first pattern
...also uncomment
transition (event) { // case WDE_JL_custom1:
Elective:
Alive-Event calls a php web script every 40 seconds.
To use this event, you must:
Attachment download
📎WatchDog.mq4 (29.29 KB)
Source: MQL5 #10615
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •