Loading…

Idle Expert Advisor Detector

An EA that stops trading rarely announces the fact. The chart still sits there looking normal, the smiley face may even still be showing, and the only real evidence is an absence - no new tickets appearing in the account history for however long the problem has lasted. Most traders find out only when they happen to glance at the account, which can be hours or days after the real EA quietly went idle. This monitor tracks the newest open or close time among orders matching a chosen magic number, or across the whole account if no magic number is given, and alerts once that timestamp has not moved for longer than a configured threshold. Because MQL4 has no API to inspect another chart's attached program directly, idle detection works from the one thing every EA leaves behind regardless of its internal state: order activity in the account. A weekday-only option suspends the idle countdown across the weekend closure, so normal market downtime is never mistaken for a stall. Notes and limitations - This cannot see whether an EA is attached, only whether matching activity has occurred - a strategy that is correctly waiting for a rare setup will also trigger the alert, so set the threshold to match the strategy's normal trading frequency. - With InpMagicToWatch left at 0, activity from any EA or manual trade resets the idle timer, which can mask one specific EA going idle while another keeps trading. - Read-only. It never sends, modifies or closes a position - only Alert and Comment are used to surface what it finds.

Expert advisor · MT4 · v1.0 · Free

About Idle Expert Advisor Detector

Idle Expert Advisor Detector is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 4 settings, such as Magic to watch, Max idle minutes and Weekdays only. MQL source code included.

Files in the download: IdleExpertAdvisorDetector.ex4, IdleExpertAdvisorDetector.mq4, IdleExpertAdvisorDetector.txt.

Settings

SettingDefaultWhat it does
Magic to watch0Magic number to watch; 0 watches every order on the account regardless of magic
Max idle minutes240Alert once no matching order has opened or closed for this many minutes
Weekdays onlytrueSuspend the idle countdown across the weekend instead of alerting on normal market closure
Check interval secs60How often to rescan orders and history

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Scripts.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the script onto a chart to run it once.

Download the PDF guide

Tags: Alerts · Trading Sessions · MT4 Expert Advisor · MQL4 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria