Candle Countdown Tag with Spread
- Indicators
-
Kazuma Uezono
MQL5 / MQL4 / Pine Script v6 developer and active trader.
Seller on the MQL5 Market (indicators for MT4/MT5).
Services:
- TradingView Pine Script to MT5/MT4 conversion (bar-by-bar matching, with tester report)
- MT4 to MT5 migration - Version: 1.2
Candle Countdown Tag with Spread shows how long the current candle has left, in a small colored tag right next to the last candle - the way TradingView shows its bar countdown. The same tag can also show the current spread, the time left of up to two more timeframes and the open time of the next candle. It is a display tool for MetaTrader 5: no alerts, no signals, no trading.
WHAT IT SHOWS
- Time left of the chart timeframe: mm:ss under one hour, hh:mm:ss under one day, "2d 04:15:30" for longer bars.
- Extra timeframe 1 and 2 (optional): for example H4 and D1 on an M15 chart, each on its own line with the timeframe name.
- Spread: in pips (10 points on 3/5-digit symbols), in points, or as a price difference.
- Next candle open time (optional): server time or your PC time, with the weekday, for example "Next Mon 00:00".
- Market closed: when the symbol's trading session is closed, the tag turns gray and shows "Market closed" and the time until the session opens again.
LOOK AND POSITION
- Next to the last candle (default): the tag follows the last price and sits a few pixels right of the last candle, like TradingView's countdown label.
- Corner panel: any of the four corners, with X/Y distance in pixels.
- Color by candle direction (green #089981 / red #F23645, the TradingView colors) or one fixed color.
- Filled box with white text (default), or plain colored text.
- Font and font size (6 to 30). Texts in English or Japanese (Auto = terminal language).
HOW THE TIME IS COUNTED
- Server time of your MT5 account. The clock keeps running between ticks and refreshes every second; daylight saving changes are handled by the terminal.
- The end of the candle is taken from the real start of the current bar plus the bar length (W1 = 7 days, MN1 = next month). This also works on brokers whose H4 or D1 bars do not start at 00:00.
- If a new bar has not received its first tick yet, the countdown continues with the next bar of the same length.
- "Market closed" is decided from the trading sessions of the symbol specification. Holidays and other closures that are not in the session table cannot be detected; on such days the countdown keeps running.
- The countdown uses the terminal's estimate of server time, which is based on your PC clock. Keep the PC clock synchronized.
FOR EA AND iCUSTOM USERS
Five hidden buffers. Values are written only on the newest bar; older bars hold EMPTY_VALUE.
0 = seconds left (chart timeframe), 1 = seconds left (extra timeframe 1), 2 = seconds left (extra timeframe 2), 3 = spread in points, 4 = market open (1) or closed (0).
When the market is closed, buffers 0 to 2 are EMPTY_VALUE.
When an EA or another indicator calls it through iCustom, nothing is drawn on any chart; only the buffers are calculated, and they are updated with each new tick (the one-second timer runs only on a chart). If an EA attaches it to another chart with ChartIndicatorAdd, it may also draw nothing there - attach it by hand or with a template when you want to see the tag.
PLEASE READ BEFORE USE
- During the first 15 seconds or so after attaching, the short name in the indicator list can briefly change to "probe#...". This is how the indicator checks whether it runs on a chart or inside iCustom. It changes back by itself.
- Several copies can run on one chart (for example one next to the candle and one corner panel). Each copy removes only its own objects.
- In the Strategy Tester it draws nothing and prints nothing.
- No DLLs, no external files, no internet connection.
- A display aid only. It does not trade and does not guarantee any trading result.
INPUTS
Contents: Show time left of the chart timeframe (true), Extra timeframe 1 (current = off), Extra timeframe 2 (current = off), Show spread (true), Spread unit (Pips), Show next candle open time (false), Next open time zone (Server time)
Position: Position (Next to the last candle), Gap right of the last candle px (12, 0-500), Corner (right upper), Panel X distance (10), Panel Y distance (24)
Style: Font (Arial), Font size (9, 6-30), Color (Candle direction), Bull candle color, Bear candle color, Fixed color, Market closed color, Filled box with white text (true), Text color on the filled box (white), Language (Auto)
If an input is out of range, the indicator does not load and writes the reason to the Experts log.
SUPPORT
Questions about installation, settings and bugs are welcome through MQL5 messages. Questions about market direction or individual trades are outside the support scope.
This is part of a series of free TV-style tools. An MT4 edition is also available as a separate product. Other tools by the same author are listed on my seller profile.
TradingView is a trademark of TradingView, Inc. This product is not affiliated with, sponsored by or endorsed by TradingView, Inc.
