Total Cost Gauge
Traders usually track spread cost and swap cost separately, if at all, and almost never add commission into the same figure before judging whether a setup's expected move is worth taking. This panel puts all three on one line: live spread and live swap are read directly from the symbol, and commission is taken as an input because MT4 exposes no function to read a broker's commission schedule - guessing it would make the whole figure worse than not showing it, so it is asked for once instead. Each component is converted to pips using the account's real tick value for the chosen lot size, not a fixed pip-value assumption, so the figure is correct on 3-digit, 5-digit and non-forex instruments alike. The break-even distance converts the combined pip total back into a price offset, which is the number that actually matters when sizing a stop or judging whether a scalp has any room left after costs. Notes and limitations - Commission is user-supplied, not read from the platform - neither MQL4 nor MQL5 exposes an API for it. A wrong value here makes every downstream figure wrong; verify it against the broker's published schedule. - Swap is converted using the current spot swap rate; brokers that apply a triple-swap day treat one of the seven nights differently, which this panel does not special-case. - Figures reflect the instrument on the chart the indicator is attached to, for one lot size and one direction at a time - it is a per-trade cost calculator, not a portfolio-wide cost report. - This is a live display, not a historical series: it has no buffered output and produces no alerts, by design.
Indicator · MT4 · v1.0 · Free
About Total Cost Gauge
Total Cost Gauge is an indicator for MetaTrader 4. It has 7 settings, such as Lots, Commission per lot and Planned nights. MQL source code included.
Files in the download: TotalCostGauge.ex4, TotalCostGauge.mq4, TotalCostGauge.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Lots | 1.0 | Lot size used for the round trip cost figure |
| Commission per lot | 0.0 | Round-trip commission per lot, in account currency |
| Planned nights | 1 | Nights the trade is assumed held, for the swap line |
| Assume long | true | Swap side to show: true = long swap, false = short swap |
| Corner x | 10 | Panel X offset from the chosen corner |
| Corner y | 20 | Panel Y offset from the chosen corner |
| Corner | CORNER_LEFT_UPPER | Chart corner the panel is anchored to |
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 → Indicators.
- 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 indicator from the Navigator onto a chart and adjust the settings.
Tags: Trailing Stop & Break-even · Risk & Lot Size · MT4 Indicator · MQL4 Source Code