Skip to main content
Give this page to your AI coding agent (or read it yourself) and it has everything needed to write indicators for the Hyperprop terminal: the script contract, the full API, working recipes, and a Pine Script porting map.

Grab the skill file

The whole recipe also ships as a single agent-skill file:
  • Download: docs.hyperprop.com/skill.txt — save it as SKILL.md (for example .cursor/skills/hyperprop-script/SKILL.md in your project, or paste it straight into your assistant).
  • Copy: the full file is at the bottom of this page in one copyable block.
Hyperprop Script is plain JavaScript, not Pine. A script declares its settings at the top level and defines one function, compute, that receives the full bar series and returns everything to draw. There is no per-bar execution model and no persistent state between runs — compute is a pure function of (bars, inputs). Scripts are created in the web terminal: Indicators → My scripts → Create script. Errors never break the chart; they render as a red inline message in the pane. Scripts sync to the user’s other devices (including mobile) automatically.

The contract

Pane type is chosen at save time: overlay (drawn over price, y = price) or separate (own pane below price, y = the script’s own value scale).

Input declarations

All return the resolved live value. opts = { key?, min?, max?, step? }. Keys default to a slug of the label; pass key to keep saved settings stable across label renames.

TA helpers (hp)

All series helpers take and return Array<number | null> aligned to bars. Nulls mark “no value yet” — always null-check before arithmetic. Anything else is ordinary JavaScript — write your own loops and math freely.

Drawing primitives

X coordinates are bar indices into bars. Fractional values and indices past the last bar are fine (the axis extrapolates), so zones and rays can extend into the future. Y is a price (overlay) or the script’s own value (separate pane). Boxes and bg bands render under the series; lines, markers, and labels render on top. Everything clips to the pane. Hard cap: 2000 items per type — return only what is currently visible/alive, never the full history.
Use rgba() colors for translucent zone fills. Plots:

Hard limits — design around these

  • 1000 ms execution budget per compute, enforced with loop guards. A script that exceeds it is circuit-broken until edited. Keep hot loops O(bars); avoid O(bars²) rescans.
  • Synchronous only. No async, no fetch, no timers — compute must return its result directly.
  • Single symbol. Scripts only receive the chart’s own bars. No cross-symbol or cross-timeframe data (Pine request.security cannot be ported).
  • No main-series restyling. Pine plotcandle / barcolor have no equivalent.
  • No persistence. Model “current state” by replaying the rules over the series inside compute (see the signal recipe).

Recipes

Oscillator (separate pane)

Zones / order blocks (overlay, boxes + markers)

The core pattern for supply/demand, FVG, and session-level indicators: build each zone’s lifecycle (created / mitigated), then emit boxes only for zones still alive at the last bar.

Signal engine (entry/SL/TP with history)

Pine keeps var state across bars; here, replay the state machine in one sequential loop. One active signal at a time; finished signals become faded markers.

Session shading (bg bands)

Intl.DateTimeFormat is available for timezone math:

Porting from Pine Script

Pine’s per-bar drawing mutation (create → move → delete) collapses into one question: what should be visible right now? Compute final state once.

Workflow

  1. Write the script (top-level input.* declarations + compute).
  2. In the terminal: Indicators → My scripts → Create script, paste, choose Overlay or Separate pane, then Save & add to chart.
  3. Compile or runtime errors appear inline in the pane in red — fix and resave. A budget-exceeded script stays disabled until edited.
  4. Settings changes in the UI re-run compute live; verify inputs by watching the legend values update.

The full skill file

One block, copy button top right — paste it into any AI coding assistant:
SKILL.md