Bentrix Docs
HomePricingDashboard

Versions, libraries and limits

Versions 1 to 6 and converting between them, libraries and import from your own folder, and the limits every script runs within.

Versions

The first line //@version=N says which version of the dialect a text is written in. Every version from 1 to 6 runs. A text with no version line is version 1; versions 1 to 4 are read onto version 5 by one pass before they are checked, so an old script runs without being edited. Completion and hover in the IDE offer each version's own words, saying what each is read as.

A newer version is never forced on a text: Convert to version 6… (or 5) in the IDE's command palette shows the converted text as a difference, and Apply makes it one edit Ctrl+Z takes back. A version later than 6 is refused by its number.

01Libraries and import

A script that declares library("name") is a library: the functions, types and enums it marks export can be used by other scripts.

//@version=6
library("MyTools")

export pct(float a, float b) =>
    (a - b) / b * 100
//@version=6
indicator("Uses MyTools")
import me/MyTools/1 as mt
plot(mt.pct(close, close[10]))

import owner/name/version as alias reaches a library in your own indicators folder — Bentrix never fetches one from anywhere. Libraries may import libraries; a cycle is refused by name.

02The limits every script runs within

The table in the reference (Settings › Assay) lists them with their defaults, read from the language itself: the evaluator steps one bar may take before the script stops with a sentence, how far back a history read with a varying offset reaches, the elements one array may hold and the characters one string may hold — and the settings that decide arithmetic: the convention of the built-ins whose two conventions differ (TA-Lib or MT5), what / makes of two whole numbers, and whether a stateful built-in is handed the absent values before its input begins.

03Stopping a long build

While a script's study computes, its legend row carries a square; a press stops the build between two bars, and the row reads stopped. Its triangle computes it again from the first bar.

04What Bentrix refuses

A built-in is refused only where Bentrix has no source for it — a third-party data feed, a company's forecast figures — and the refusal names what is missing. The reference marks each one.

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