Script Lab

Write indicators that fit your way of reading the market.

Use the visual Builder as a starting point, edit the generated JavaScript when you need more control, and preview the result on real market data.

Start here

A script receives the candle data available in the chart and returns one or more series. The Builder generates this shape for you; the Script tab lets you inspect, copy, and edit it.

const values = api.candles.map(function (c) {
  var value = Number(c['funding_rate']);
  return Number.isFinite(value) ? value : null;
});

return [{
  name: 'Funding rate',
  type: 'line',
  data: values,
}];

Start with one field and one output. Add transforms, comparisons, and extra series only after the first result is visible.

Data fields

Use fields such as close, volume, funding_rate, open_interest, long_short_ratio, volatility, MVRV, and other fields exposed by the current candle feed.

Choose a field in Builder

Transforms and relations

Build from raw values, SMA, z-score, change, percentile, streak, normalization, distance to moving average, or compare two fields with agreement, divergence, correlation, spread, ratio, and interaction.

Examples to build next

Each example should explain what market relationship it measures, what a high or low reading means, and when the signal is incomplete.

Debugging checklist

  • Return an array of series with a name, type, and data.
  • Return `null` when history is missing or a value is not finite.
  • Confirm the field name in Builder before writing it manually.
  • Run the preview before saving or publishing the indicator.