XFlow Script

The indicator language of XFlow Charts. One document, complete enough to write a working indicator from, on candles, the footprint, the tape, quotes, depth of book, individual orders, options gamma and what the chart's own indicators draw.

Updated 2026-10-12

What XFlow Script is

XFlow Script is the small, deterministic language that draws custom indicators on an XFlow Charts chart. It is series first and PineScript flavoured. It runs inside your browser and the desktop and phone apps, on the bars your chart is already showing, and it draws through the chart renderer instead of drawing itself.

A script can read every kind of market data the chart holds: the candles, the per price footprint ladder, the individual trades of the tape, the best bid and offer, the depth of book, the life of each individual resting order and every add, change, fill and cancel, the options gamma levels, the markers the Big Trades indicator drew, the zones Effort Zones and Range Absorption drew, and the values of an open built in indicator it extends. It can draw lines, bands, zones, boxes, markers, dots, text, vertical lines, straight segments, recoloured candles, custom volume profiles with a look of their own, filled rectangles with gradients, polygons, footprint style cells, a histogram on the price axis edge, a table in a chart corner, a readout panel and a whole sub panel, and it can raise alerts with a sound and a popup.

A script is plain text. You write it, or an AI writes it, and you paste it into the Custom Indicator Builder in the Indicators window. The builder compiles it as you type and reports one status line. When it reads Compiled, the indicator appears on the chart and any settings the script declares appear underneath the editor.

The five facts that decide whether a script compiles

  • Line 1 must be exactly //@xfscript 1. Nothing else identifies the text as XFlow Script.
  • Every statement lives on one line. A call may never be split across lines.
  • Loops exist and are bounded: for and while run at most 100,000 passes per bar. There are no arrays, no objects, no imports and no property access, and whole bar answers such as tape.largest_size or cell.poc_price are one call, so reach for a loop only when no builtin answers the question.
  • Every name you call must be in the builtin tables on this page. Anything else is rejected before the script runs.
  • Types are checked on every bar. An int series that resolves to nan stops the run.
The smallest complete indicator
//@xfscript 1
indicator("Simple Average")

let length: int = input.int(20, "length", "Length", 2, 400, 1)
plot.line(ta.sma(close, length), "#22C55E", 2, "solid")

Paste that into the builder and the chart draws a 20 period average with a Length control under the editor.

Browse the reference

Every layer of the market, Orderflow to optionflow, on one chart.

Institutional grade Orderflow data with backtesting and journaling built in. Join the waitlist for early access.

Get Access