Bentrix Docs
HomePricingDashboard

What Assay is

Bentrix's script language — an indicator or a strategy as a short text, run bar by bar on the chart. Scripts of the widely used charting dialect open and run as they are.

Assay is the language Bentrix runs scripts in. A script is a short text that says, for one bar, what to compute and what to draw — an average, a band, a mark where two lines cross — and Bentrix runs it on every bar of the chart, oldest first, the newest bar again on each tick while it forms. What it draws appears on the chart like a built-in study: in the legend, with a settings card of its own inputs, on every chart type.

01The dialect, and Assay's own

Assay reads the widely used charting dialect in which a great many published indicators are written. A script beginning //@version=5 or //@version=6 opens and runs as it is; a script of versions 1 to 4 — or with no version line, which is version 1 — runs too, read onto version 5 by one pass before it is checked. Converting a script's text to a newer version is never done silently: it is a command of the IDE, shown as a difference you apply.

Where Bentrix adds something the dialect does not have, it is marked as Assay's own in the reference — today talib.*, every function of the TA-Lib library by its own name. Nothing Assay adds ever takes a name a script might use for itself: a script's own declaration always wins.

02What Bentrix runs, and how it tells you

Of the dialect's built-ins, Bentrix runs most as written and some with a convention of its own, said in each one's note — an average seeded the way the study's Calculation setting says (TA-Lib or MT5), a volume that is the tick volume where the feed carries no traded volume. A handful are refused by name, because Bentrix has no source for them (a third-party data feed, an earnings forecast). The reference lists every built-in with its disposition, and a script that uses a refused one is told so in a sentence when it is checked, never run halfway.

03Where scripts live

An Assay script is a file ending .assay in your indicators folder (☰ › Settings › Indicators shows where it is). A script there appears under My indicators in the chart's indicator menu; a script declaring strategy(…) is saved as a strategy and appears in the Strategies panel instead. A file dropped onto Bentrix, or text pasted into a new script, opens in the IDE, which says whether it is an indicator or a strategy and where it will go.

A script you add is run only after you tick it in Settings › Indicators — a script an agent installs, or one you replace, waits for your tick again.

04The future, read on purpose

The dialect lets a script read data the bar it stands on could not yet have known — a higher timeframe's candle before it closed, for instance. In Bentrix that runs only where you allow it: two switches in ☰ › Settings › Assay, one for laboratory workbenches and one for paper and real ones, both off. A study that reads the future is marked on the chart wherever it draws: its legend says reads the future, and the bars it repainted are shaded. In a laboratory that can be what you want to study; elsewhere it is a script describing a past that was never visible. See look-ahead.

05Where to go next

Bentrix 0.1.382Every number, name and default on these pages is read from the application itself.What is comingWhat changed