Loading…

Cost Drag Odometer

Every closed trade quietly pays three separate costs: commission, swap and the spread crossed on entry. The terminal's own history view shows commission and swap per order, but never totals them, and never shows spread cost at all. This panel scans closed trade history for the current calendar month and adds commission and swap up in real terms, refreshing on every tick. Spread cost is the one figure native MQL4 cannot recover exactly - the platform does not store the spread that was actually in force at the moment a given trade opened. Rather than pretend otherwise, this tool estimates it honestly: for each qualifying trade it applies the symbol's CURRENT spread (in points) to that trade's lot size. On a symbol whose spread barely moves this is close to the true figure; on a symbol with wide variable spreads it is a rough guide only, and the panel labels it "(est.)" so nobody mistakes it for a recorded fact. The month rolls over automatically at midnight on the 1st, server time, without needing the chart to be reloaded. Notes and limitations - Commission and swap figures come straight from OrderCommission() / OrderSwap() on each qualifying closed order and are exact. - The spread figure is a CURRENT-spread estimate applied retroactively to each trade's lot size, not the spread actually paid at entry - MQL4 keeps no record of that. Treat it as directional, not exact, especially on symbols with volatile spreads. - Balance and credit history entries are skipped; only OP_BUY/OP_SELL closed trades are counted. - Does not include open (still-running) trades' accrued swap - only history already closed this month.

Indicator · MT5 · v1.0 · Free

About Cost Drag Odometer

Cost Drag Odometer is an indicator for MetaTrader 5. It has 7 settings, such as Text color, Back color and Corner. MQL source code included.

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

Settings

SettingDefaultWhat it does
Text colorclrWhitePanel text colour
Back colorclrDarkSlateGrayPanel background colour
CornerCORNER_LEFT_UPPERScreen corner
X offset10Horizontal offset in pixels
Y offset20Vertical offset in pixels
Font size9Panel font size
All symbolsfalseInclude every symbol's history (false = this chart symbol only)

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: MT5 Indicator · MQL5 Source Code

MetaTrader 4 & 5 indicators · PolyMaria