Equity Milestone Annotator
"When did I first pass 10,000?" is a question most trading journals answer only by scrolling through history by hand. This script rebuilds a running balance timeline from the account's closed-trade and balance-operation history, detects every point where that running balance crosses a round milestone, and drops a labelled up or down arrow on the current chart at the closest bar to that moment. The naive version of this marks every step a large deposit or trade jumps past in one go, which produces a cluster of markers all at the same instant and implies the account paused at each one along the way - it did not. This script marks only the highest milestone newly reached by a given history event, which is the honest read of what actually happened. Notes and limitations The starting balance used for the running total is approximated as "current balance minus the sum of every history record's profit, swap and commission" - this is exact if the account's full trading history is still available in the terminal, but understates the true starting deposit if older history has already aged out and been purged. Markers are only placed within the current chart's loaded history; a crossing that happened before the oldest loaded bar is still counted for the running total but is silently skipped for drawing (no bar exists to anchor it to). History is sorted by close time with an insertion sort, which is efficient for a normal account's history but would be slow against several thousand records. Marking only the highest milestone per event (not every intermediate step skipped over) is a deliberate simplification, not a bug - see the full description.
Script · MT4 · v1.0 · Free
About Equity Milestone Annotator
Equity Milestone Annotator is a script for MetaTrader 4. It draws buy and sell arrows on the chart and can alert you with a pop-up, sound, email or push message. It has 6 settings, such as Milestone step, Up color and Down color. MQL source code included.
Files in the download: EquityMilestoneAnnotator.mq4, EquityMilestoneAnnotator.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Milestone step | 1000.0 | Milestone spacing, in deposit currency |
| Up color | clrLimeGreen | Marker colour when balance rises through a milestone |
| Down color | clrCrimson | Marker colour when balance falls through a milestone |
| Font size | 8 | Label font size |
| Arrow offset pips | 15 | Vertical clearance between the bar and the marker, in pips |
| Object prefix | EQM_ | Prefix for objects this script draws |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Scripts.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the script onto a chart to run it once.
Tags: Buy/Sell Arrows · Alerts · MT4 Script · MQL4 Source Code