OPEN-SOURCE SCRIPT
Aktualisiert

Daily High & Low Time Map (HOD / LOD)

627
Daily High & Low Time Map

What it does
This indicator counts, across the completed trading days that your chart has loaded, which time window of the day produced the daily high and which produced the daily low. The result is a two-row heat strip in its own pane, lined up in time under the running day, plus a dashboard that answers the one question that actually matters intraday: at this hour, in how many of the past days was the final high still ahead? Every number carries its sample size, so you can see when a bright cell stands on three days instead of three hundred.

How it works
The script walks the chart bar by bar, never leaves the timeframe you are on and never requests data from a higher timeframe. A day is a span between two anchor points that you choose; inside that span each confirmed bar can move the running high and low. The time bucket of an extreme is taken from the opening time of the bar that produced it, so a later part of the day can never move an earlier reading.
  • A day is closed on the first bar of the next day and written once into a ring buffer; the running day is never part of the statistics.
  • The bucket index comes from the bar opening time in the anchor timezone, which follows daylight saving. The repeated hour of the autumn change stays inside the same day, which is capped at 100 % coverage instead of counting as an error.
  • Days below the coverage threshold - half days, data gaps, the clipped first day of a replay - are dropped and reported as skipped instead of silently diluting the counts.
  • Filters for weekday, day type and sample window are applied while counting; stored days are never modified. Shares carry a Wilson score interval, which stays inside 0 to 100 % even when a bucket holds no hits or every hit.


How to use it
  1. Add the script. It opens in its own pane below the chart.
  2. Pick the day definition that matches the instrument: midnight New York for index and FX charts, the 18:00 anchor for CME futures, the 09:30 anchor when only the cash session interests you, midnight UTC for symbols that trade around the clock.
  3. Read the upper row of the strip as "how often the daily high was made here" and the lower row as the same for the daily low. Brighter means more often.
  4. Read the dashboard line "High still ahead" as a conditional share over completed days, never as a statement about today.
  5. If the cells look pale and the note says the sample is small, widen the slot or load more history before you read anything into them.


What makes it original
Time-of-day statistics for highs and lows exist, and so do session boxes; what this script does differently is refuse to hand out a number without the evidence behind it. Every share is printed with the sample it came from and with a Wilson confidence interval, so a bucket built from eleven days does not read like one built from two hundred. Days are admitted only when they carry enough bars to be comparable, and the dropped ones are counted in plain sight. The map is a strip of buckets rather than a table, because the question is a shape. The conditional row extends the same idea forward: given the time of day, how much of the day's high-making is still ahead - again with the sample attached.

Inputs
Behaviour:
  • Day definition - where a trading day starts: Midnight New York, Futures 18:00 NY, RTH 09:30 NY or Midnight UTC. Session windows use the same timezone, and an evening session is labelled by the calendar day it ends on.
  • Slot width - 15, 30 or 60 minutes. A bucket narrower than one chart bar is raised automatically and the dashboard says so.
  • Min day coverage % - a day counts only with at least this share of the bars of the fullest day on the chart. Range 10-100, default 60.
  • Last N days - size of the ring buffer. Range 5-1000, default 250.
  • Tie rule - which occurrence wins when the same price is reached twice in a day.
  • Use start date and Start date - restrict the sample to days after a fixed date. Off by default.
  • Mon, Tue, Wed, Thu, Fri - on by default. Sat and Sun - off by default. Auto-include weekends for 24/7 symbols - on by default; crypto includes both anyway.
  • Day type - all days, or only those that closed above or below their open.
  • Asia, London KZ, NY AM KZ, Lunch, NY PM KZ - session windows, one dashboard row each; a bucket counts when any part of it falls inside. NY AM KZ drives the session-start alert.
  • Show Silver Bullet rows - three fixed one-hour rows. Off by default.
  • Count current slot as still open - whether a day whose extreme fell into the current bucket counts as ahead. On by default.
  • Ahead alert threshold % - level at which the ahead alert fires. Range 1-99, default 25.
  • Ramp scaling - relative to the busiest bucket, or a fixed scale so two symbols can be compared.
  • Strip mode - both rows, high only, low only, or one combined row counting either extreme.

Presentation: whether the strip, dashboard, live row, Wilson bounds, sparkline, session rows and the H and L markers are drawn, the dashboard corner and text size, the marker size and background, the two colour ramps and the theme.

Signals and alerts
  • Entering high-frequency high slot - fires on bar close when price enters the bucket that held the daily high most often in the current sample.
  • Entering high-frequency low slot - the same for the daily low.
  • Ahead alert - fires on bar close the first time the share of days with a later high falls below the threshold.
  • Session start - fires on the first bar inside the NY AM window.
  • New running day extreme - fires on bar close when the running high or low of the day has moved.

The first three depend on the aggregation, which is evaluated on the most recent bar. They are meant for live use; on historical bars they stay silent.

Repainting
Every state change happens on a confirmed bar. The running day is written into the sample only on the first bar of the next day, so the current day never influences a count. The bucket of an extreme is taken from the opening time of the bar that made it and is stored once; nothing rewrites it later. There is no request for a higher timeframe and no lookahead, so a reload and a bar replay produce the same numbers.

Limitations
  • The map is suppressed above a certain timeframe and whenever the chart bar does not divide the bucket width - on a daily chart every day is one bar, and on a 45-minute chart with 60-minute buckets some buckets get twice as many bars. The strip stays empty and the note line says why. Use a minute timeframe that divides the bucket width.
  • The sample is the loaded chart history, nothing more: at 20 000 bars roughly 14 days on 1-minute futures, 51 on a 1-minute regular-hours stock chart, 72 on 5-minute futures, 256 on 5-minute regular hours, 217 on 15-minute futures, 430 on 30-minute and 870 on hourly. The dashboard prints the number it has.
  • Small samples move. Below 30 days the cells are dimmed on purpose, and a share out of ten days is a number, not a finding.
  • Buckets the chart has no bars for - the night hours of a regular-hours stock chart - stay dark. That is missing data, not a measurement.
  • On a 1-minute chart the strip cannot be drawn more than 500 bars into the future; the dashboard reports how many buckets were left out.
  • It describes the past of one symbol on one chart and says nothing about where today's high will be.


This script is a charting tool for educational purposes. It does not provide financial advice and does not predict future price movement. Trading carries risk; decisions and their outcome remain yours.
Versionshinweise
Added
  • Detailed dashboard - an optional full statistics table that appears in the main chart while the heat strip stays in its own pane.
  • Today's high and low display toggle - show the running extremes as bucket start times or as slot numbers.
  • Today's low in the Detailed dashboard - shown alongside the existing running high using the same stored daily state.


Changed
  • The default dashboard is now compact - it uses at most two rows with Still ahead, sample size and today's high/low bucket, so the lower pane no longer needs to be enlarged for the full table.
  • Dashboard warnings are condensed into the Still ahead row with a fixed priority instead of consuming additional rows in Compact mode. Detailed mode keeps the complete Notes row.
  • Wilson interval and sparkline settings are now active only while the Detailed dashboard is enabled. Existing alert conditions and alert text are unchanged.


Fixed
  • Lower-pane dashboard crowding - the full information table no longer competes with the heat strip for vertical space by default.
Versionshinweise
Improved
  • Clearer compact dashboard labels and full High/Low wording.
  • Percentages are rounded to whole numbers and the sample is shown as days.


Fixed
  • Today times now always use clean HH:MM formatting without decimal-hour artifacts.

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.