feature

Dependency outputs

Declaring a dependency is not the same as having a number on every bar. Warmup, purge, and timeframe gaps often leave values empty even when the declare is correct.

Read this when plots look blank, studies skip rows, or you see dependency_output_unavailable. The fix is usually “guard nulls” or “fix the declare,” not more math.

Pattern

  1. indicators.declare (and for studies, flows.declare).

  2. Read via ctx.indicators.* / ctx.flows.* / event payloads.

  3. Guard null / undefined / empty history before plotting, emitting, or collecting.

function onBar(ctx) {
  const atr = ctx.indicators.atr;
  const v = atr && atr.value;
  if (v == null) return; // declared, no data yet
  ctx.plot("atr", v);
}

Declared vs had-data

State

Meaning

Not declared

Lint / contract error — fix declare

Declared, empty value

Normal warmup / gap — guard and skip

dependency_output_unavailable

Contract mismatch or missing series — fix declare / version / output id

Agent note

Use resolve_dependency_contract before inventing dependency shapes. Prefer request_add_indicator when the human must approve adding a dep.

Next

  1. Dependency unavailable

  2. Declaring indicator dependencies