DrawdownMeter v1.10 - User Guide
=================================
The underwater profile of your TRADING, cleanly separated from your
balance line: deposits and withdrawals are excluded on purpose.

WHAT IT DOES
------------
Builds the cumulative realized-P/L curve from every market deal, entry
deals included, so the curve carries the full commission bill (swap
and commission included) in chronological order, then reports:

- Maximum drawdown in money, with peak date, trough date and the
  recovery date (or NOT YET). If you provide your starting balance,
  the depth is also shown as a percent of the equity peak.
- The longest underwater period in days across the whole history.
- The CURRENT state: at a new peak, or how deep and how many days
  below the last peak you are right now.
- A table of the deepest N drawdown episodes with dates and lengths.

Why it matters: before you can judge a losing streak ("is this normal
or is something broken?") you must know your own historical envelope -
typical depth, typical duration. This script prints that envelope.

Read-only: opens nothing, needs no algo-trading permission.

INSTALLATION AND RUNNING
------------------------
1. Copy DrawdownMeter.mq5 to MQL5\Scripts, refresh, compile if edited.
2. Toolbox -> History -> right-click -> "All history".
3. Drag onto any chart, set inputs, press OK; read Toolbox -> Experts.

INPUTS
------
InpStartBalance (default 0)
    Your account's starting balance. When set, drawdowns are also
    expressed as a percent of the equity peak. Left at 0, the script
    reports money-only figures.
InpTopN (default 5)
    How many of the deepest episodes to list.
InpExportCSV (default false)
    Writes DrawdownEpisodes.csv to MQL5\Files (every episode, not just
    the top N) for your own charting.

READING THE OUTPUT
------------------
- "recovered NOT YET" on the max-drawdown line means the worst episode
  of your history is the one you are inside right now.
- Compare the CURRENT line against the deepest-episodes table: a
  current drawdown well inside the historical envelope (both in depth
  and in days) is weather, not damage.
- The longest-underwater figure is usually more uncomfortable - and
  more useful - than the deepest one. Patience budgets are set in
  days, not dollars.

NOTES
-----
- One position is one round turn: a partial close fires several exit
  deals but is counted once, so the trade count is not inflated.
- Resolution is per closed trade: floating (intra-trade) excursions
  are not visible, so live equity dips can exceed these figures.
- Multi-strategy accounts mix all magics into one curve here; for a
  per-system view and correlations, see the Portfolio Correlation
  Analyzer companion tool.
- The script assumes the server returns deals in chronological order
  (standard MT5 behaviour).

License: free to use, modify and redistribute. No warranty.
