OPEN-SOURCE SCRIPT
ที่อัปเดต:

Timeframe Marker - know when timeframes start/end

3 882


When you're on a lower timeframe, it's important to know which timeframes are starting/ending.

Timeframe Marker will display a bars that stack notifying you of your chosen timeframes.

For example, if you're on the one minute chart or another low timeframe, you'll be aware of the larger timeframes are about to begin or start.

It's always good to select the lowest timeframe first in ascending order so that the lowest bar is the lowest timeframe and bars that stack on top are larger timeframes.

The default timeframes are:
• 5 minutes (green)
• 15 minutes (yellow)
• 1 hour (orange)
• 4 hour (red)
• daily (blue)
• weekly (purple)
• monthly (gray)


If your chart's timeframe is higher than the timeframe marker you've selected, then it won't display a bar stack for that timeframe as it would normally display on every bar (this is to avoid clutter).

The future timeframe marks basically will offset to future timeframes. Set how many bars forward you'd like to see.
Release Note
Updated the colors.
Release Note
made colors stand out.
Release Note
turned off display for numbers as it was unnecessary.
Release Note
TIMEFRAME MARKER 2.0 — where the higher-timeframe candles close, past AND future, on your chart

Complete redesign — and a change of home: the boundary marks now live ON the price chart as
vertical lines through price, instead of the old separate-pane histogram you had to
cross-reference. Up to SEVEN timeframes, each with its own switch, timeframe and color.

━━━ WHAT YOU SEE ━━━
• PAST closes: vertical lines at every close of each enabled timeframe (how many are kept per
timeframe is yours; higher timeframes draw thicker; solid/dashed/dotted + transparency yours).
• The NEXT close of every timeframe, projected at the exact future bar where it will land, with
a live COUNTDOWN riding it: "4H · 1h 12m".
• A PROGRESS PANEL: each timeframe's countdown plus a candle-progress meter (▰▰▰▰▰▱▱▱ = 62%
of the 4H candle elapsed). Position, size and fine nudge offsets included.
• THE CANDLE CLOCK: a big live countdown to one chosen timeframe's close — green while there's
time, then yellow at 45s, orange at 30s, red at 15s, reset on the new candle. Place it
floating beside price (with bar + vertical offsets), as the top row of the panel, or off.
A "realtime tick boost" quietly borrows updates from three liquid symbols (yours to change)
so the clock keeps ticking even when the chart symbol is quiet.
• Nearby countdowns MERGE into one label with a row per timeframe — no overlapping text when
the day, week and month close together.
• Optional PERIOD SHADING: stripe alternate periods of one chosen timeframe (e.g. alternate
days on a 15m chart) so HTF candle groupings are visible at a glance.

Channels auto-hide when meaningless — a 5m marker on a daily chart would paint every bar, so it
stays silent until the chart is below its timeframe.

━━━ WHY THE FUTURE MARKS ARE SAFE ━━━
The projection is pure calendar math (Pine's time_close with a negative offset) — no
request.security, no lookahead, nothing repaints. Only WHEN candles close is marked, never any
future price. Non-24/7 markets follow the exchange session calendar; on crypto it is exact.

━━━ PRESETS ━━━
Classic (all seven: 5m/15m/1H/4H/1D/1W/1M) · Scalper (intraday only) · HTF bias (4H and up) ·
Session (1H/4H/1D) · User defined.

━━━ ALERTS ━━━
One alert ("Any alert() function call"):
• when an enabled timeframe's candle closes — the message names every timeframe on that bar
• and optionally X minutes BEFORE a close ("4H closes in 14m") — one heads-up per candle. Use a
chart timeframe comfortably smaller than the warning window.

━━━ HONESTY ━━━
This is a time ruler, not a signal — HTF closes are moments of attention, not predictions.
Not financial advice.

Portions of this script were developed with AI assistance; all logic was reviewed and tested by me.

━━━ CHANGELOG (2.0) ━━━
• Changed: moved onto the price chart — vertical boundary lines through price replace the
separate-pane histogram columns.
• Added: live countdown labels on each timeframe's projected next close, merging into rows when
closes land together.
• Added: the candle clock — a big traffic-light countdown (green → yellow 45s → orange 30s →
red 15s), placeable beside price or inside the panel, with a realtime tick boost borrowed
from liquid symbols.
• Added: progress panel with per-candle elapsed meters, position/size/nudge controls.
• Added: alternating period shading, pre-close warning alerts, close alerts naming every
timeframe that closed, presets, tooltips, full text-size ranges, and an independent on/off
switch for every visual element.
• Fixed: the future-marks distance is now capped inside Pine's forward-plotting ceiling (the
old version could error out when set too high), and the channel switches resolve to a clean
true/false internally.

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน