Skip to content

Free MT5 indicator

Candle Countdown Timer

Shows the time left until the current candle closes and the live spread in a label next to price, updated every second.

Utilityv1.0MetaTrader 5 (MQL5) Compiles with 0 errors Non-repainting signals Alerts

What it does

FXP Candle Countdown shows how long the current candle has left before it closes, together with the current spread, in a small label beside the price. When the close is near, the label changes color so you notice it.

It is useful whenever your rules depend on a candle close, such as waiting for a close beyond a level before acting, and on higher timeframes where the remaining time is not obvious from the chart.

How it works

  1. The open time of the current candle is read for the chart timeframe. Its close time is open time plus the timeframe length; for monthly candles the next calendar month is used.
  2. Time remaining = close time - current server time. The server time is the later of the last tick time and the terminal's estimate of trade-server time, so the countdown keeps moving when no ticks arrive.
  3. The result is formatted as mm:ss, hh:mm:ss or days plus hh:mm:ss, depending on the timeframe.
  4. The spread is the symbol's current spread in points.
  5. A one-second timer refreshes the label independently of ticks. In "next to price" mode the label moves with the bid; in corner mode it stays fixed.
  6. The optional alert fires once per candle when the remaining time drops below the chosen number of seconds.

How to use it

Copy the .ex5 file into MQL5/Indicators and attach it to a chart.

Watch the timer when a candle is about to close near a key level, so you can judge the close rather than an intrabar spike. The spread readout helps you avoid entering at moments of unusually wide pricing, such as the daily rollover. For a deeper look at trading costs, see the glossary entry on spread.

If the label overlaps price action on a busy chart, switch to corner mode and choose a corner that is free.

Settings

InputDefaultWhat it changes
Show current spreadtrueAdds the spread to the label.
Place label next to pricetrueNext to price or in a corner.
Bars to the right of the last bar3Gap between the last candle and the label.
Corner when not next to priceRight lowerCorner used in corner mode.
Font size / font name10 / ConsolasLabel styling.
Normal text colorsilverRegular color.
Color in the final secondsorangeWarning color.
Final seconds that use the warning color30When the warning color starts.
Alert shortly before the bar closesfalseOptional pre-close alert.
Seconds before close for the alert10Timing of the alert.

Limitations

  • The countdown assumes candles close on schedule. When a market is closed (weekends, holidays, session breaks), the next candle opens later than the timer shows.
  • The time comes from your broker's server clock and the terminal's estimate of it; small differences of a second or so are normal.
  • The spread is a snapshot and can change between the update and your order.
  • A timer does not change the risk of a trade; trading involves substantial risk of loss.

Key inputs

Key inputs of Candle Countdown Timer
InputDefaultDescription
Show current spreadtrueAdds the live spread in points to the label.
Place label next to price (false = corner)trueFollows the bid price to the right of the last candle, or sits in a chart corner.
Bars to the right of the last bar3Horizontal gap between the last candle and the label.
Color in the final secondsOrangeWarning color used near the close.
Final seconds that use the warning color30How early the warning color kicks in.
Alert shortly before the bar closesfalseOptional alert once per bar, a set number of seconds before the close.

Educational tools, not advice. Indicators and Expert Advisors describe price; they do not predict it, and past behaviour does not guarantee future results. Test everything on a demo account first and never risk money you cannot afford to lose. See our disclaimer.

Keep exploring

Related mt5 indicators