Watch how to download trading robots for free
Find us on Twitter!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Indicators

Spread and Swap Monitor - indicator for MetaTrader 5

Views:
31
Rating:
(1)
Published:
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

Spread and Swap Monitor on XAUUSD M15Spread and Swap Monitor shows what trading a symbol actually costs, right on the chart. Spread on gold (XAUUSD), oil and many forex pairs can jump several times wider around news, the daily rollover and thin sessions, and swap can quietly eat into trades you hold overnight. This indicator puts both in plain view.

Separate window

  • A histogram of the spread of each bar, in points.
  • A moving average of the spread (50 bars by default).
  • Bars where the spread was unusually wide turn red: wider than a multiple of the average (2x by default) or above a fixed number of points if you set one.

Where the spread comes from:

  • Auto (default) uses the per-bar spread stored in your broker's history and, for bars where the broker stored none, rebuilds the widest bid/ask spread of each bar from tick history (the last 500 bars by default).
  • Bar history only or Tick history only can be chosen instead.
  • The forming bar always shows the widest live spread seen so far.

Panel on the price chart

  • Spread now, in points and in price, and how it compares with the average (red when wide).
  • Average spread and today's tightest/widest live spread since the indicator was loaded.
  • Swap long and swap short with their unit, plus the amount in account currency per 1 lot when the broker quotes swap in points. Negative swap is shown in red.
  • The triple-swap day for the symbol.
  • Time left until the current bar closes, server time and local time. The countdown keeps running between ticks.

An optional alert fires when the live spread turns wide, with a pause between alerts so it never spams.

Notes

  • Tick history is loaded by the terminal on demand, so the first rebuild can take a few seconds; the indicator retries on its own.
  • Spread values are in points of the symbol (for a 3-digit gold quote, 1 point is 0.001).
  • Swap values come straight from the symbol's specification at your broker.

The indicator only reads prices and symbol settings and draws on the chart. It never opens, modifies or closes trades and makes no promise about results.

Inputs

  • Spread source — Auto — Auto, bar history only, or tick history only
  • Bars rebuilt from tick history — 500 — How many recent bars use tick history
  • Average spread period — 50 — Length of the spread average
  • Wide factor — 2.0 — Bar is wide when spread > factor x average
  • Wide fixed points — 0 — Also wide above this many points (0 = off)
  • Show info panel — true — Turn the panel off
  • Panel X / Y offset — 10 / 20 — Panel position in pixels
  • Panel font size — 9 — Text size
  • Panel text / warning colour — grey / red — Panel colours
  • Alert when live spread becomes wide — false — Pop-up alert on a wide spread
  • Minimum seconds between alerts — 300 — Alert pause
ATR Risk Planner ATR Risk Planner

Plans ATR-based stop loss and take profit levels for a buy and a sell from the current price and works out the lot size for the account risk you choose.

MTF Trend Matrix MTF Trend Matrix

A compact dashboard that shows the EMA trend direction and ADX strength of several symbols across several timeframes at once.

Accelerator Oscillator (AC) Accelerator Oscillator (AC)

The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.

MACD Signals MACD Signals

Indicator edition for new platform.