Loading…

Drawdown Monitor With Alerts

Most drawdown displays reset their "peak equity" the instant the indicator is reloaded, which quietly understates how deep a drawdown really is if the terminal was restarted mid-drawdown. This monitor stores the equity high-water mark in a GlobalVariable keyed to the account number, so the peak survives a terminal restart, a chart template reload, or the indicator being removed and re-attached. Only a deliberate InpResetPeakOnInit = true (set back to false afterwards) starts a fresh high-water mark, for example after an intentional withdrawal that should not read as a drawdown. The drawdown line only has history from the point the indicator was first attached forward - account equity for bars before that point was never recorded anywhere and cannot be reconstructed, so those bars are left blank rather than guessed at. A corner label shows the live peak, current equity, current drawdown percentage and the worst drawdown observed since attachment. The alert is edge-triggered: it fires once at the moment drawdown crosses up through the threshold on a closed bar, then stays silent while drawdown remains above it, so a choppy equity curve hovering near the line cannot spam the same warning on every tick. Notes and limitations - The high-water mark is stored per account number in a terminal GlobalVariable and is shared by every chart running this indicator on the same account - attaching it to several charts does not create several independent peaks. - Drawdown history only exists from the moment the indicator was first attached; bars before that are left blank because equity at those past moments was never recorded. - The alert checks once per closed bar, not on every tick, matching how the rest of this catalogue throttles alerts - on a fast-moving account this means notice can lag the real crossing by up to one bar. - Purely informational: it does not close positions, disable trading or take any protective action on its own.

Indicator · MT4 · v1.0 · Free

About Drawdown Monitor With Alerts

Drawdown Monitor With Alerts is an indicator for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 3 settings, such as Alert threshold pct, Alerts and Reset peak on init. MQL source code included.

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

Settings

SettingDefaultWhat it does
Alert threshold pct10.0Drawdown percent that triggers an alert on bar close
AlertstrueAlert once when drawdown crosses above the threshold
Reset peak on initfalseSet true once to reset the stored high-water mark to current equity, then set back to false

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 → Indicators.
  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 indicator from the Navigator onto a chart and adjust the settings.

Download the PDF guide

Tags: Alerts · MT4 Indicator · MQL4 Source Code

MetaTrader 4 & 5 indicators · PolyMaria