Skip to content
FXNook HubBeta

Alex / Spread and Candle Timer Indicator for MT4

MetaTrader 4IndicatorMITCompiled · build 2425
AlexFirst version.build 2425v1.05 hours ago1 version
README

Overview

Shows the live spread and a countdown to the candle close next to price or in a chart corner, and turns the spread red when it is above your limit.

Two numbers matter right before you click: how wide the spread is and how long until the candle closes. This small utility shows both on the chart, updates every second and changes the spread colour when it is wider than your limit, so you do not enter during a spike.

How it works

  • Spread is read from the live Ask and Bid: (Ask - Bid) / Point, rounded to whole points. On 3- and 5-digit symbols it can be shown in pips (points / 10).
  • If the spread is above Spread limit points, the spread text uses the warning colour.
  • Time left is the end of the current candle minus the current server time. Monthly candles end at the start of the next month.
  • The text refreshes every second from a timer, not only on ticks, so the countdown keeps running in quiet markets. MT5 uses the terminal's trade-server clock; MT4 runs the last tick time forward with the local clock.
  • When the countdown passes zero before a new tick arrives, the timer shows "waiting for the next tick".
  • Two display modes: next to price (text a few bars to the right of the current candle, at the Bid) or in a corner of the chart.

Inputs

InputDefaultWhat it does
PositionNext to priceNext to price or in a corner
Shift bars3Next to price: bars to the right of the current candle
CornerRight lowerCorner mode: which corner
X / Y distance10 / 20Corner mode: offset in pixels
Show in pipstruePips on 3/5-digit symbols (false = points)
Spread limit20Points; above this the spread turns to the warning colour
Text colourDarkGrayNormal colour
Warning colourOrangeRedSpread colour above the limit
Font / sizeConsolas / 10Text style

How to use it

  1. In MetaTrader open File > Open Data Folder.
  2. MT4: copy FXN_SpreadCandleTimer.mq4 into MQL4/Indicators. MT5: copy FXN_SpreadCandleTimer.mq5 into MQL5/Indicators.
  3. Right-click Indicators in the Navigator and choose Refresh (or restart the terminal). The file compiles on first use; you can also open it in MetaEditor and press Compile.
  4. Drag the indicator onto a chart and set the inputs.

Set Spread limit to the most you accept for that symbol, for example 20 points (2 pips) for EURUSD on a standard account, or higher for gold and indices. If the text covers candles in "next to price" mode, increase the chart shift (the small triangle at the top of the chart) or switch to corner mode.

Good to know

  • The spread shown is the broker's current quote; it can widen quickly around news and the daily rollover.
  • In the Strategy Tester the spread is the tester's spread setting.
  • It does not place, change or close trades; it only displays information.
  • The objects use the prefix FXN_SCT_ and are removed when you remove the indicator.

Trading carries risk. Test on a demo account first; past results do not predict future results.

At a glance

What it is
A free Indicator for MetaTrader 4, written in MQL4.
What it does
Shows the live spread and a countdown to the candle close next to price or in a chart corner, and turns the spread red when it is above your limit.
Shared by
Alex
Licence
MIT
Version
1.0 (1 Dec 2026)
Settings
14 inputs
Lab check
Compiled with MetaEditor build 2425 for MT4 on 1 Dec 2026: 0 errors, 0 warnings.
Price
Free to download

Settings read from the code

InputTypeDefaultNote
InpSep1string=== Position ===---- Position ----
InpPositionENUM_SCT_POSITIONSCT_AT_PRICEWhere to show the text
InpShiftBarsint3Next to price: bars to the right of the current bar
InpCornerENUM_BASE_CORNERCORNER_RIGHT_LOWERCorner mode: which corner
InpXint10Corner mode: horizontal distance in pixels
InpYint20Corner mode: vertical distance in pixels
InpSep2string=== Spread ===---- Spread ----
InpInPipsbooltrueShow pips on 3/5-digit symbols (false = points)
InpMaxSpreadint20Spread limit in points (colour changes above it)
InpSep3string=== Style ===---- Style ----
InpColorcolorclrDarkGrayNormal text colour
InpHighColorcolorclrOrangeRedSpread colour above the limit
InpFontstringConsolasFont name
InpFontSizeint10Font size

How to use it

  1. Download the compiled file (or the source and compile it in MetaEditor).
  2. Put it in MetaTrader: File → Open Data Folder → MQL4 → Indicators, then refresh the Navigator.
  3. Test it on a demo account before any real money.
  4. Want changes? Open a copy in your Lab and ask for them in plain words.