Candle Countdown Tag with Spread MT4
- 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.1
Candle Countdown Tag with Spread MT4 puts a TradingView-style countdown on your MT4 chart: a small tag beside the last candle that tells you when the bar closes, together with the current spread. Optional extra lines show the time left of two more timeframes and when the next candle opens. Nothing else - it does not trade, alert or give signals.
ONE TAG, UP TO FIVE LINES
Line | Example | Setting
Chart timeframe | 12:41 | on by default
Extra timeframe 1 | H4 02:12:41 | off (choose a timeframe to turn it on)
Extra timeframe 2 | D1 13:12:41 | off
Next candle open | Next Tue 08:00 | off; server time or PC time
Spread | Spread 1.2 pips | on; pips, points or price
Time format: mm:ss below one hour, hh:mm:ss below one day, "Nd hh:mm:ss" above.
When the trading session of the symbol is closed, the tag turns gray and reads "Market closed" plus "Opens in ..." until the next session.
PLACEMENT AND COLORS
- Beside the last candle (default, gap 12 px) or as a panel in one of the four corners.
- Tag color follows the current candle (bull #089981, bear #F23645) or uses one fixed color; a separate color for "market closed".
- Filled box with white text, or text only. Font and size 6-30.
- Language: Auto (terminal language), English or Japanese. With Japanese text and the Arial font, the tag switches to Meiryo UI so the characters display correctly.
MT4 NOTES - PLEASE READ
1. The screen moves with ticks. MT4 redraws the chart when a tick arrives or when you scroll or zoom. The values are recalculated every second, but if no tick comes in (quiet market, weekend), the numbers on the screen can look frozen until the next redraw. The buffers of the attached indicator are still updated every second.
2. Server time. MT4 has no server clock function, so the indicator measures the difference between your PC clock and the server time on every new tick and adds it to the PC clock. The last measured difference is remembered, so a chart opened at the weekend still shows server time. Keep your PC clock synchronized.
3. Colors come from the inputs. The tag is made of chart objects, so all colors are set in the Inputs tab.
4. Inputs have no group headings in MT4; they are listed in the order shown at the end of this page.
HOW THE END OF A BAR IS FOUND
The indicator takes the real open time of the current bar and adds the bar length (W1 = 7 days, MN1 = to the 1st of next month). Brokers whose H4 bars start at 01:00, 05:00 ... are therefore handled correctly. Open or closed is read from the session table in the symbol specification; holidays or extra closures that are not in that table are not recognized, and the countdown keeps running on those days.
KNOWN LIMITS
- All times are server time (the next-open line can be switched to PC time; the offset is rounded to 15 minutes).
- For a few seconds after attaching, the short name in the indicator list may show "probe#..." while the indicator checks whether it runs on a chart. It returns to normal by itself.
- Called through iCustom from an EA or another indicator, it draws nothing on any chart and starts no timer; it only fills the buffers. Attached to another chart by an EA with ChartIndicatorAdd, it may also draw nothing - attach it by hand or with a template to see the tag.
- Nothing is drawn in the Strategy Tester.
- No DLLs, no files, no internet access.
- This is an information display. It places no trades, and no trading result is promised.
iCUSTOM BUFFERS
5 buffers, not drawn, filled only on the newest bar (EMPTY_VALUE elsewhere):
0 seconds left on the chart timeframe | 1 seconds left on extra timeframe 1 | 2 seconds left on extra timeframe 2 | 3 spread in points | 4 market open = 1, closed = 0.
Buffers 0-2 are EMPTY_VALUE while the market is closed. Same order as the MT5 edition.
Through iCustom the values are recalculated each time your EA calls iCustom (there is no one-second timer in that case).
INPUTS (MT4 ORDER)
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 = Next to the last candle; Gap right of the last candle = 12 px (0-500); Corner = right upper; Panel X distance = 10; Panel Y distance = 24; Font = Arial; Font size = 9 (6-30); Color = Candle direction; Bull / Bear / Fixed / Market closed color; Filled box with white text = true; Text color on the filled box = white; Language = Auto.
Out-of-range values stop the indicator from loading, with the reason in the Experts log.
SUPPORT
Help with installation, settings and bug reports via MQL5 messages. I do not answer questions about market direction or specific trades.
The MT5 edition (a separate product) and 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.
