Monthly Statement Rollup
MT4's own Account History tab is one long chronological list mixing real trades with balance operations - deposits, withdrawals, credit adjustments - and gives no monthly subtotal at all. Reading "did the account actually grow from trading, or mostly from deposits" out of that list by eye means manually separating the two kinds of row for every month in the history. This script walks the whole history once, buckets every row into its calendar month, and keeps trades and balance operations in separate columns rather than merging them into one profit figure. Trading rows contribute to trade count, gross profit, commission and swap (summed into a net profit column); balance-operation rows contribute to a separate count and total. The result is written to CSV, one row per month, sorted oldest to newest. Notes and limitations The output has no running account-balance column - reconstructing the true balance curve needs the complete history back to account opening, which this script has no way to confirm it has. "net_profit" per month is the sum of that month's own trading results only; "balance_ops_total" is kept in its own column rather than folded into net_profit, since a deposit is not trading profit. Only rows MT4 has already loaded into the Account History tab are seen - if a month looks short or missing, load "All History" first and re-run. This MetaEditor build has no predefined OP_BALANCE/OP_CREDIT constants (compiles as "undeclared identifier" if used directly) even though they are documented standard MQL4 order-type values elsewhere - the script defines the raw order-type codes (6 and 7) locally instead of relying on the named constants.
Script · MT5 · v1.0 · Free
About Monthly Statement Rollup
Monthly Statement Rollup is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 2 settings, such as From date and To date. MQL source code included.
Files in the download: MonthlyStatementRollup.ex5, MonthlyStatementRollup.mq5, MonthlyStatementRollup.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| From date | 0 | Only include rows on/after this date (0 = no lower bound) |
| To date | 0 | Only include rows on/before this date (0 = no upper bound) |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Scripts.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the script onto a chart to run it once.
Tags: Alerts · MT5 Script · MQL5 Source Code