time

Adds a time input field to your indicator’s Inputs panel. This is useful for session boundaries, alert times, or any setting where the user must specify a precise time (within a range).

Syntax

input.time(title, value, id?, min, max, tooltip?, group?, inline?)

Parameters

  • title string — Label shown in the Inputs panel.

  • value number — Default time value (numeric representation, typically seconds or timestamp depending on implementation).

  • id string (optional) — Unique key for referencing this input. If omitted, it is auto-generated from title (lowercased, spaces removed).

  • min number — The earliest allowed time value.

  • max number — The latest allowed time value.

  • tooltip string (optional) — Help text shown on hover.

  • group string (optional) — Groups this input with others inside a collapsible section.

  • inline string (optional) — Aligns multiple inputs in the same row if they share the same key.

Return Value

{ id: string } — The assigned id for this time input.

Example

Result

Tips

  • Use consistent numeric formats (e.g., 930 for 9:30 AM, 1600 for 4:00 PM).

  • Combine time() with session() for full session customization.

Warning

Good Practice

Last updated