OPEN-SOURCE SCRIPT
HTF Time Markers [twr]

HTF Time Markers [twr]
This indicator plots higher-timeframe (HTF) period boundaries directly on your current chart, giving you a clean visual reference for where each new HTF candle begins — without needing to switch charts or add a separate HTF overlay.
Key Features

Useful as a quick reference for whether price is trading above or below the current HTF open — a key reference level in many ICT/SMC frameworks.
How It WorksPine Script®
The indicator tracks the start of each new HTF bar using request.security and draws a vertical marker at that boundary. In Session Range mode, the box continues updating its top/bottom/right edges on every bar until the HTF period closes, giving you a live read on the developing range. At the same time, an independent open-price line is plotted at the HTF candle's opening price and extended according to your chosen mode. Older markers and lines are automatically pruned once you exceed your configured maximums, keeping the chart uncluttered.
Use Case
Useful for traders who reference higher-timeframe context (e.g. 4H, Daily, Weekly opens) while executing on a lower timeframe, and want both a visual cue for where each HTF candle starts and a persistent open-price reference level — without constantly toggling chart resolutions.
This indicator plots higher-timeframe (HTF) period boundaries directly on your current chart, giving you a clean visual reference for where each new HTF candle begins — without needing to switch charts or add a separate HTF overlay.
Key Features
- Auto Timeframe Detection — Automatically selects an appropriate HTF based on your current chart resolution (e.g. 5m chart → 15m markers, 1H chart → 4H markers), or set a manual timeframe if you prefer full control.
Two Display Modes - Full Height — draws a vertical line stretching across the entire chart at the start of each new HTF period.
- Session Range — draws a live-updating box confined to the actual high/low range of the developing HTF candle, expanding in real time as the period forms.
- HTF Open Price Line — Plots a horizontal line at the open price of each HTF candle, independent of the vertical marker settings. Choose how it extends:
- Until Next Period — stops automatically where the next HTF candle begins.
- Full Right — extends indefinitely into future bars.
- Full Chart — extends across the entire chart in both directions.
Useful as a quick reference for whether price is trading above or below the current HTF open — a key reference level in many ICT/SMC frameworks.
- Smart Timestamp Labels — Each vertical marker is labeled with contextual text that adapts to the timeframe:
- Sub-weekly HTFs show time and weekday (e.g. "09:30 / Monday"), or weekday-only if preferred.
- Weekly HTFs show the week-of-month (e.g. "Week 2").
- Monthly, Quarterly, and Yearly HTFs show calendar-relative labels (month name, quarter number, or year) instead of a redundant time stamp, since higher-timeframe opens always land on the same weekday/time.
- Timezone Control — Labels are calculated using a selectable timezone (default America/New_York), so your markers align with the session times your strategy is actually built around, rather than the raw exchange timezone.
- Full Styling Control — Independently adjust color, width, and style (solid, dotted, dashed) for both the vertical markers and the open line, plus label size and a configurable cap on how many historical markers/lines are kept on the chart.
How It Works
The indicator tracks the start of each new HTF bar using request.security and draws a vertical marker at that boundary. In Session Range mode, the box continues updating its top/bottom/right edges on every bar until the HTF period closes, giving you a live read on the developing range. At the same time, an independent open-price line is plotted at the HTF candle's opening price and extended according to your chosen mode. Older markers and lines are automatically pruned once you exceed your configured maximums, keeping the chart uncluttered.
Use Case
Useful for traders who reference higher-timeframe context (e.g. 4H, Daily, Weekly opens) while executing on a lower timeframe, and want both a visual cue for where each HTF candle starts and a persistent open-price reference level — without constantly toggling chart resolutions.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.