Spot Future Spread Meter
Some brokers quote both a cash/spot instrument and a related futures or CFD contract on the same symbol list - a cash index next to its front-month future, a spot metal next to its futures contract. The gap between the two is not a fixed number: it moves with time to expiry, financing rates and demand for each leg, so a naive fixed-pip alert either fires constantly or never fires at all depending on which instrument it was tuned on. This indicator instead tracks the raw spread (futures close minus spot close) alongside its own InpAveragePeriod-bar rolling average, so "wide" and "narrow" are judged against this specific pair's own recent behaviour rather than an arbitrary constant. An optional alert fires once per closed bar when the current spread pulls away from its own average by more than InpDivergenceThreshold price units. Both legs are read independently through iClose with no assumption about either symbol's contract size, tick value or margining - those are broker and instrument specific and this tool only ever compares quoted prices, not position value. Notes and limitations Requires the broker to actually quote both symbols - if InpFuturesSymbol is not available, the lines read empty and a one-time warning is printed to the Experts log. The average needs a full InpAveragePeriod window of closed bars on both symbols; recently-listed futures contracts will show a shorter usable history than the spot leg. This tool compares raw quoted prices only - it does not attempt to convert either leg into account-currency P/L or account for either instrument's own contract size, margining or expiry roll, all of which are broker/contract specific and outside a chart indicator's scope.
Indicator · MT5 · v1.0 · Free
About Spot Future Spread Meter
Spot Future Spread Meter is an indicator for MetaTrader 5 based on Divergence. It can alert you with a pop-up, sound, email or push message. It has 5 settings, such as Futures symbol, Symbol suffix and Average period. MQL source code included.
Files in the download: SpotFutureSpreadMeter.ex5, SpotFutureSpreadMeter.mq5, SpotFutureSpreadMeter.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Futures symbol | Related futures/CFD symbol quoted alongside the chart's spot symbol (required) | |
| Symbol suffix | Broker suffix appended to InpFuturesSymbol, leave blank if none | |
| Average period | 20 | Bars the spread's own rolling average is built over |
| Divergence threshold | 0.0 | Alert when |spread - average| exceeds this, in price units of the spot symbol (0 = never) |
| Alerts | true | Alert once per closed bar when the divergence threshold is crossed |
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 → Indicators.
- 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 indicator from the Navigator onto a chart and adjust the settings.
Tags: Alerts · Divergence · MT5 Indicator · MQL5 Source Code