Trading Cost Monitor Spread Swap Commission
- Indicators
-
Kazuma Uezono
MQL5 / MQL4 / Pine Script v6 developer and active trader.
Seller on the MQL5 Market (indicators for MT4/MT5).
Services:
- TradingView Pine Script to MT5/MT4 conversion (bar-by-bar matching, with tester report)
- MT4 to MT5 migration - Version: 1.1
Trading Cost Monitor is an indicator for MetaTrader 5 that shows the trading costs of all symbols in your Market Watch (or of a list you enter) in one sortable table on the chart: the current spread, the average, 95th percentile and maximum spread seen since you attached it, swap long and short per lot per day in your account currency, commission, and the round-trip cost of 1 lot.
All values are what your broker's server reports for your account, plus the spreads the indicator has observed since it was attached. They describe the present and the past only. They do not predict or guarantee future costs, they do not rate brokers, and they are not a signal or advice on what or when to trade.
It is display only: it never places, modifies or closes orders. Free.
Features
- One table for up to 300 symbols: Symbol, Spread (points), Pips (FX symbols), Avg / P95 / Max spread since start (points), Swap L, Swap S (1 lot, 1 day, account currency), Comm (per lot per side), RT 1 lot (round-trip cost), Quotes (number of quotes sampled).
- Click a column header to sort, click again to reverse. Rows without a value always stay at the bottom.
- Filter box on the panel: part of a symbol name, several terms separated by commas (for example "JPY,XAU"). Pages for long lists, collapsible panel, any corner.
- Swap converted to the account currency for the usual swap modes. The symbol tooltip shows the swap mode and the triple-swap day.
- Commission read automatically from your last closed trade of each symbol, or entered by you.
- Optional CSV log: one line per symbol at the interval you choose (and when you remove the indicator) with the interval average / min / max spread, the totals since start, point value, swap and commission. Saved in MQL5\Files\TradingCostMonitor.
- Marks on the panel: "~" approximate, "h" commission from history, "-" no data or no conversion rate, dimmed value with a unit = value not converted, "..." loading.
Main Inputs
- Symbols: Market Watch or a symbol list (comma separated, exact names), maximum symbols (1-300, default 100), start filter, sampling and refresh interval (1-60 seconds, default 1).
- Commission: source (from closed trades in history, else the value below / always the value below), commission per lot per side in account currency (0 = not set), history to search (1-3650 days, default 90).
- CSV log: on / off (default off), interval (1-1440 minutes, default 15), file name tag.
- Panel: corner, offsets, rows per page (5-50, default 20), font, font size, start collapsed, draw candles behind the panel (default on), 8 colors.
- 27 inputs in 4 groups.
How It Is Calculated
- Spread (points) = (Ask - Bid) / Point. Pips are shown for FX symbols only: points / 10 for 3- and 5-digit symbols, otherwise the same as points.
- Avg / P95 / Max: at each refresh interval the indicator reads the latest quote of every symbol and records it once if it has changed since the last read. The first quote after attaching is not counted (it can be an old quote). P95 comes from a histogram: exact to 1 point for normal spreads; for very wide spreads the bins become wider and the error is at most half a bin (CSV column p95_step_pt).
- Point value (1 lot, account currency) = tick value / tick size x point. When the terminal reports a tick value that is not converted to the account currency (seen with some CFDs), the indicator uses point x contract size x conversion rate.
- Conversion rate: from a symbol in your Market Watch, directly or via USD or EUR (for example HKD -> USD -> JPY).
- Round trip 1 lot = current spread x point value + 2 x commission per side. Swap, slippage and other fees are not included.
- Swap (1 lot, one normal day) by the symbol's swap mode: points, base, margin, profit and deposit currency and interest % are converted. Interest % at the open price is calculated with the current price and marked "~". Reopen modes are shown as the raw value with its unit.
- Commission from history: for each symbol, the most recent closed position within the history days; its commission + fee of all deals divided by the volume opened is the round trip, and half of it is shown per side (with "h"). Symbols without such a trade use the input value or show "not set".
Notes and Limits
- Use only one copy per chart. The object names are fixed, so two copies on one chart overlap. If you use the symbol-list mode on several charts, add those symbols to Market Watch first.
- While attached, the indicator turns off the chart property "Chart on foreground" so that candles are drawn behind the table, and restores it when removed. If you save a template or profile while it is attached (candles in the background), the template keeps "Chart on foreground" off. Turn it back on in the chart properties if needed, or set "Draw candles behind the panel" to false.
- The terminal itself may add currency pairs it needs for conversion to Market Watch (for example NZDJPY and NZDUSD for AUDNZD). They can stay after the indicator is removed. In list mode the indicator adds missing symbols to Market Watch and, when removed, takes out only the ones it added (the terminal refuses if a chart or order uses the symbol).
- Values are what your broker reports now and what was observed in the past. They do not guarantee future costs. Spreads, swaps and commissions can change at any time, and spreads can be much wider than recorded here, for example in fast or thin markets.
- The record starts when the indicator is attached; there is no spread history before that. Removing it, changing inputs, symbol or timeframe, or restarting the terminal starts a new record (the CSV keeps earlier lines). Only one quote per symbol per interval is sampled, so very short spikes between two reads can be missed.
- A quote older than 5 minutes (for example in a closed market) is shown dimmed.
- Commission from history reflects past trades and can differ from the current fee schedule. Commission charged in another way (for example as separate balance entries) is not detected; then enter it yourself. The entered value is used for all symbols.
- If no conversion rate is found, RT shows "-", swap shows the raw value, and the tooltip tells which currency to add to Market Watch.
- The panel text is English only. Symbol names longer than 16 characters are shortened.
- The panel does not evaluate times of day. The CSV only records server time and GMT time.
- In the Strategy Tester only the chart symbol is shown, with the spread of the test settings, without CSV and history. Use it on a normal chart to see your account's values.
Compatibility and Support
- MetaTrader 5 only. FX, metals, indices, stocks, crypto and other CFDs, any timeframe, hedging and netting accounts.
- No DLLs, no internet access. It writes files only when the CSV log is on.
- Support through MQL5 messages, reply within 3 business days: installation, settings and bug reports. We cannot recommend brokers, symbols or trading times, give market views or make trade decisions for you.
