High/Low of Day
Developing high and low of the current regular session as labeled levels, with optional history.
- HOD/L
- Built into Spectral
- Updates every tick
- high of day
- low of day
- intraday
- session range
MIT-0: free to use, change and share, no attribution needed. What you build from it is yours.
Already in Spectral: add it from the Indicators toolbox. The file here is the same indicator written as a custom indicator, to change or learn from. Installed, it appears next to the built-in one, marked Custom.

Overview
High/Low of Day tracks the highest high and the lowest low of the latest New York regular session (09:30-16:00, to 13:00 on early-close days) and draws them as two labeled levels. Before the session opens it falls back to the extremes of all bars of the latest date.
How to read it
The levels show the range of the current session. A test of the high or low of day shows whether the range is expanding; a reclaim or rejection there is common intraday context. Treat a touch as information, not as an entry by itself.
Settings and limitations
Show history adds step lines that show how each session's high and low developed bar by bar. Use a bar size of 15 minutes or less: with larger bars, the bar that contains the 09:30 open starts earlier and is not counted as part of the session.
Notes
Matches the built-in HOD/L in Spectral on bar sizes up to 15 minutes. On larger bar sizes the built-in reads 30-minute regular-session bars to stay exact, which a custom indicator cannot do in schema v1.
Settings
Each setting appears in the indicator's settings panel in Spectral, next to a color setting for every output.
| Setting | Type | Default | Range or options | What it does |
|---|---|---|---|---|
| Show history | On / off | Off | — | Also draw how each session's high and low developed bar by bar, as step lines. |
What it draws
Lines
- HOD historydotted · 1 px · primary
#C98282 - LOD historydotted · 1 px
#C98282
Levels
- HODsolid · 1 px · value on the axis
#C98282 - LODsolid · 1 px · value on the axis
#C98282
Source
Save it as hod-l.js and add it with Indicators → Custom indicators → Add file…. The format is explained in the custom indicators guide.
// Copyright (c) 2026 Spectral
// SPDX-License-Identifier: MIT-0
// Free to use, copy, modify and share: https://spectral.trade/docs/custom-indicators/LICENSE.txt
/** @type {import('./spectral-indicator').IndicatorV1} */
export default {
schemaVersion: 1,
id: 'hod-l',
name: 'High/Low of Day',
shortName: 'HOD/L',
version: '1.0.1',
author: 'Spectral',
description: 'Developing high and low of the current regular session as labeled levels, with optional history.',
pane: 'price',
live: { lookback: 0 },
inputs: {
showHistory: { type: 'boolean', label: 'Show history', default: false, description: 'Also draw how each session\'s high and low developed bar by bar, as step lines.' },
},
levels: {
high: { label: 'HOD', color: '#C98282', showValue: true },
low: { label: 'LOD', color: '#C98282', showValue: true },
},
plots: {
highHistory: { label: 'HOD history', color: '#C98282', lineStyle: 'dotted', primary: true },
lowHistory: { label: 'LOD history', color: '#C98282', lineStyle: 'dotted' },
},
docs: {
overview: 'High/Low of Day tracks the highest high and the lowest low of the latest New York regular session (09:30-16:00, to 13:00 on early-close days) and draws them as two labeled levels. Before the session opens it falls back to the extremes of all bars of the latest date.',
howToRead: 'The levels show the range of the current session. A test of the high or low of day shows whether the range is expanding; a reclaim or rejection there is common intraday context. Treat a touch as information, not as an entry by itself.',
settings: 'Show history adds step lines that show how each session\'s high and low developed bar by bar. Use a bar size of 15 minutes or less: with larger bars, the bar that contains the 09:30 open starts earlier and is not counted as part of the session.',
notes: 'Matches the built-in HOD/L in Spectral on bar sizes up to 15 minutes. On larger bar sizes the built-in reads 30-minute regular-session bars to stay exact, which a custom indicator cannot do in schema v1.',
},
calculate(ctx) {
const { bars, inputs, ta, time } = ctx;
const widen = (range, bar) => {
if (range === null) return { high: bar.high, low: bar.low };
if (bar.high <= range.high && bar.low >= range.low) return range;
return { high: Math.max(range.high, bar.high), low: Math.min(range.low, bar.low) };
};
// The day's regular-session and whole-day ranges carry from bar to bar through ta.scan; a new New York date
// starts them again.
const states = ta.scan(bars, { date: '', regular: null, any: null }, (state, bar) => {
const date = time.ny(bar).dateKey;
const fresh = date !== state.date;
const previousRegular = fresh ? null : state.regular;
const regular = time.isRegularSession(bar) ? widen(previousRegular, bar) : previousRegular;
const any = widen(fresh ? null : state.any, bar);
// A bar that changes nothing returns the state itself, which ta.scan keeps without copying it.
if (!fresh && regular === state.regular && any === state.any) return state;
return { date, regular, any };
});
const highHistory = states.map((state) => (inputs.showHistory && state.regular !== null ? state.regular.high : null));
const lowHistory = states.map((state) => (inputs.showHistory && state.regular !== null ? state.regular.low : null));
const last = states.length > 0 ? states[states.length - 1] : null;
const latest = last === null ? null : last.regular !== null ? last.regular : last.any;
return {
levels: { high: latest === null ? null : latest.high, low: latest === null ? null : latest.low },
plots: { highHistory, lowHistory },
};
},
};Adapt it with an LLM
Paste this into your assistant and replace the second-to-last line with the change you want.
Start from this Spectral custom indicator: https://spectral.trade/indicators/hod-l.js Format reference: https://spectral.trade/docs/custom-indicators.llm.md Keep the file format and every rule of the reference; give the result a new id, name, shortName and version, and update docs and input descriptions to match. Keep its live updates exact and fast (section "Fast live updates" of the reference): carry values from bar to bar only through ctx.ta, and raise live.lookback if the change reads further back; Spectral rejects a file whose live updates differ from a full recalculation or are too slow. Change I want: <describe the change> Answer with the complete file in one code block, ready to save as <id>.js.


