Loading…

Fill Slippage Chart Marks

MQL4 keeps no "requested price" field on an order once it exists - only the actual fill price. A byte-accurate slippage figure would need the terminal's own trade dialog to log the price it sent, which no indicator can see. This tool instead keeps a rolling reference: the Bid/Ask recorded on the tick immediately before a brand-new ticket is first detected. When a fresh market order appears on the chart's own symbol, its fill price is compared against that reference and marked on the chart as an adverse (worse than reference), favourable (better than reference), or flat mark, with the magnitude in points printed alongside. This is an honest estimate, not a broker-certified slippage report - see the limitations below for exactly when it can be wrong. It exists for a trader who wants a running visual sense of whether their fills are typically landing where expected, not for dispute evidence. Notes and limitations Deliberate deviation from the usual "clean up your own objects in OnDeinit" rule: these marks are meant to function as a historical log of fills, so by default they are left on the chart when the indicator is removed, the same way native trade arrows persist. InpClearMarksOnRemove restores the usual cleanup behaviour for anyone who prefers it. Every object is still name-prefixed, so removal (manual or via the input) never touches anything else on the chart. The reference price is only as good as the tick just before the fill was detected. A fill that happens during a gap in local tick delivery, or a very long stretch since the indicator's last processed tick, will compare against a stale reference and can misreport the true slippage. Orders that already existed before the indicator was attached are never marked, since no pre-attach reference price was ever recorded - this only measures fills that happen while it is running. Only market orders (OP_BUY/OP_SELL) on the chart's own symbol are marked; pending orders and other symbols are ignored.

Indicator · MT5 · v1.0 · Free

About Fill Slippage Chart Marks

Fill Slippage Chart Marks is an indicator for MetaTrader 5. It draws buy and sell arrows on the chart. It has 6 settings, such as Flat epsilon points, Magic filter and Clear marks on remove. MQL source code included.

Files in the download: FillSlippageChartMarks.ex5, FillSlippageChartMarks.mq5, FillSlippageChartMarks.txt.

Settings

SettingDefaultWhat it does
Flat epsilon points3.0Below this many points, mark as flat/neutral (grey) rather than adverse or favourable
Magic filter-1Only mark fills carrying this magic number, -1 = all
Clear marks on removefalseDelete all marks when the indicator is removed (off keeps them as a permanent log)
Colour adverseclrCrimsonFill priced worse than the pre-fill reference
Colour favourableclrForestGreenFill priced better than the pre-fill reference
Colour flatclrSilverFill within InpFlatEpsilonPoints of the reference

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Indicators.
  3. Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
  4. Open the .mq5 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: Buy/Sell Arrows · MT5 Indicator · MQL5 Source Code

MetaTrader 4 & 5 indicators · PolyMaria