Spread Cost Compounding Visualiser
Spread cost is almost always quoted per trade, which is exactly the framing that makes it easy to dismiss - a couple of pips reads as nothing next to a single winning trade. It stops reading as nothing the moment it is multiplied by how often you actually trade and shown as a yearly total instead of a per-trade one, because spread is paid on every single trade regardless of whether that trade wins, loses, or breaks even. This script takes your stated trades-per-day and typical lot size, derives the account-currency value of the current spread from TickValue and TickSize rather than assuming they are interchangeable (TickSize can be a multiple of Point on some symbols, and using TickValue directly as "value per point" silently overstates the true cost whenever that is the case), and reports the resulting cost per trade, per day, per week, per month, and per year, plus that yearly figure as a percentage of current account equity. It then goes one step further than a plain cost total: it treats the yearly spread bill as a recurring annual contribution and computes its future value as a compounding annuity at a assumed rate of return, across 1, 3, 5 and 10 year horizons. This reframes the number honestly - not "you lost X in spread this year," but "X invested instead would have become Y by year five" - which is the actual, compounding cost of a recurring drag rather than its one-year snapshot. Notes and limitations - This is a projection from stated inputs, not a measurement of your actual trading history. It is only as accurate as the trades-per-day and lot-size figures you provide. - The live spread reading is a single snapshot at the moment the script runs, not an average over the trading session - spread widens around news and session opens, so a quiet-moment reading can understate the real average. Run it a few times at different points in the day, or use the manual override with your own observed average. - The compounding annuity projection is a standard future-value-of- annuity calculation, not a guarantee of any specific return - it illustrates opportunity cost under an assumption you control, and changing InpAssumedAnnualReturnPct changes the answer accordingly. - Commission, if your broker charges it separately from spread, is not included - this script measures spread cost only.
Script · MT5 · v1.0 · Free
About Spread Cost Compounding Visualiser
Spread Cost Compounding Visualiser is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 6 settings, such as Trades per day, Lots per trade and Trading days per year. MQL source code included.
Files in the download: SpreadCostCompounding.ex5, SpreadCostCompounding.mq5, SpreadCostCompounding.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Trades per day | 5.0 | Your actual average trades per trading day |
| Lots per trade | 0.10 | Typical lot size per trade |
| Trading days per year | 252 | Trading days per year (252 is the usual forex convention) |
| Use current spread | true | Use the live spread instead of a manual figure |
| Manual spread pips | 2.0 | Spread in pips, used only when InpUseCurrentSpread is false |
| Assumed annual return pct | 8.0 | Assumed annual return if this money were invested instead |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Scripts.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the script onto a chart to run it once.
Tags: Alerts · MT5 Script · MQL5 Source Code