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
- 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.
- 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.
- The result is formatted as mm:ss, hh:mm:ss or days plus hh:mm:ss, depending on the timeframe.
- The spread is the symbol's current spread in points.
- 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.
- 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
| Input | Default | What it changes |
|---|---|---|
| Show current spread | true | Adds the spread to the label. |
| Place label next to price | true | Next to price or in a corner. |
| Bars to the right of the last bar | 3 | Gap between the last candle and the label. |
| Corner when not next to price | Right lower | Corner used in corner mode. |
| Font size / font name | 10 / Consolas | Label styling. |
| Normal text color | silver | Regular color. |
| Color in the final seconds | orange | Warning color. |
| Final seconds that use the warning color | 30 | When the warning color starts. |
| Alert shortly before the bar closes | false | Optional pre-close alert. |
| Seconds before close for the alert | 10 | Timing 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.

