Every method of client.indicator in the Julia SDK.
ide_board#
Read or arrange the Assay IDE's board · tool ide_board
The board of the script in front: where each statement's cluster stands, laid out by hand, kept beside the script in the indicators folder and never in its text. Read answers it; place moves one statement's cluster; tidy lays them all again in the text's order; forget deletes the arrangement. A view act, as a person's drag of a cluster's body is: no byte of the script changes. The script must be saved into the indicators folder.
Declaration
client.indicator
ide_board(action; index = nothing, x = nothing, y = nothing)Parameters
| Name | Type | What it is | |
|---|---|---|---|
action | any | required | read answers the arrangement; place puts statement index (from 0, in the text's order) at x, y; tidy lays every statement again in the text's order; forget deletes the arrangement. |
index | any | optional | |
x | any | optional | |
y | any | optional |
Returns
Dict{String,Any} — the tool’s answer as a Dict.
What it answers
What the tool's description says.
Example
client.indicator.ide_board("…")ide_edit#
Set the text in the Assay IDE · tool ide_edit
Sets the whole text of the tab in front of the Assay IDE, as typing does: checked at once, one entry the person's Ctrl+Z takes back, nothing saved (indicator_install saves). Answers the IDE as ide_state does, with the new findings.
Declaration
client.indicator
ide_edit(source)Parameters
| Name | Type | What it is | |
|---|---|---|---|
source | any | required | The whole new text of the tab in front. |
Returns
Dict{String,Any} — the tool’s answer as a Dict.
What it answers
Answers the IDE as ide_state does, with the new findings.
Example
client.indicator.ide_edit("…")ide_graph#
Read the Assay IDE's graph · tool ide_graph
Answers the sheet of the tab in front of the Assay IDE: a row per statement with its own line number and the kind of thing it is, and inside each row the nodes it draws, each with its kind, its label and the lines its text stands on. The same sheet the window draws, read the same way a person reads it. Writes nothing.
Declaration
client.indicator
ide_graph()It takes no arguments.
Returns
Dict{String,Any} — the tool’s answer as a Dict.
What it answers
Answers the sheet of the tab in front of the Assay IDE: a row per statement with its own line number and the kind of thing it is, and inside each row the nodes it draws, each with its kind, its label and the lines its text stands on.
Example
client.indicator.ide_graph()ide_graph_edit#
Make a gesture on the Assay IDE's graph · tool ide_graph_edit
Makes one gesture on the sheet of the tab in front, exactly as a person's press or drag makes it: written into the text by the same function, one entry the person's Ctrl+Z takes back, checked as typing is, nothing saved. A gesture the sheet refuses is answered with its sentence and changes nothing. Answers the IDE as ide_state does.
Declaration
client.indicator
ide_graph_edit(gesture)Parameters
| Name | Type | What it is | |
|---|---|---|---|
gesture | any | required | One gesture of the sheet, as ide_graph's rows and nodes name the text: {"SetLiteral": {"at": span, "value": "20"}}, {"Wire": {"from": span, "to": span, "cast": null}}, {"AddRow": {"after": span, "text": "…"}}, {"MoveRow": …}, {"DeleteRow": …}, {"WrapIn": {"first": span, "last": span, "with": "If"}}, {"Extract": …} and the rest; a span is {"start": {"line": l, "col": c}, "end": {…}} exactly as ide_graph answers it. |
Returns
Dict{String,Any} — the tool’s answer as a Dict.
What it answers
Answers the IDE as ide_state does.
Example
client.indicator.ide_graph_edit("…")ide_open#
Open a script in the Assay IDE · tool ide_open
Opens the Assay IDE on a script of the indicators folder by its file name, brought to the front if a tab holds it already, or on a new script's text in a new tab, not saved. Answers the IDE as ide_state does.
Declaration
client.indicator
ide_open(; file = nothing, source = nothing)Parameters
| Name | Type | What it is | |
|---|---|---|---|
file | any | optional | A script of the indicators folder by its file name (mean.assay), brought to the front if a tab holds it already. Give this or source. |
source | any | optional | Or a new script's whole text, in a new tab, not saved. |
Returns
Dict{String,Any} — the tool’s answer as a Dict.
What it answers
Answers the IDE as ide_state does.
Example
client.indicator.ide_open()ide_state#
Read the Assay IDE · tool ide_state
Answers whether the Assay IDE is open, its tabs (each tab's number, name, whether it is unsaved and whether it is in front, and the tab shown beside it in a split), and the tab in front: its name, file, text, findings and stops with their conditions. Writes nothing.
Declaration
client.indicator
ide_state()It takes no arguments.
Returns
Dict{String,Any} — the tool’s answer as a Dict.
What it answers
Answers whether the Assay IDE is open, its tabs (each tab's number, name, whether it is unsaved and whether it is in front, and the tab shown beside it in a split), and the tab in front: its name, file, text, findings and stops with their conditions.
Example
client.indicator.ide_state()ide_stop#
Put or take a stop in the Assay IDE · tool ide_stop
Puts a stop on a line of the script in front of the Assay IDE, with the condition it stops on, or takes it away, as F9 and the stop's condition field do. A run and inspect then says where it fires. Answers the IDE as ide_state does.
Declaration
client.indicator
ide_stop(line, on; condition = nothing)Parameters
| Name | Type | What it is | |
|---|---|---|---|
line | any | required | The line of the script in front, from 1. |
on | any | required | True puts a stop there (or changes its condition), false takes it away. |
condition | any | optional | The condition it stops on, an expression of the script (n % 2 == 1); empty or absent: whenever the line runs. |
Returns
Dict{String,Any} — the tool’s answer as a Dict.
What it answers
Answers the IDE as ide_state does.
Example
client.indicator.ide_stop(1, true)install#
Install a study script · tool indicator_install
Writes a study script into the person's indicators folder: a Python study, or an Assay script when the file name ends.assay. A file already there is written over only with replace, and then waits for the person's tick like a new one. It is not run - not even read for its declaration - until the person ticks it in Settings › Indicators. Answers the file and its state.
Declaration
client.indicator
install(file_name, source; replace = nothing)Parameters
| Name | Type | What it is | |
|---|---|---|---|
file_name | any | required | The script's file name in the indicators folder: [a-z0-9_]{1,32}, with or without.py; with.assay for an Assay script. |
source | any | required | The script's whole text: one @study, as bentrix.study declares it; or an Assay script, which script_check checks first. |
replace | any | optional | True writes over the script already in the folder under this name (the Assay editor's Save); the file is then the agent's and waits for the person's tick again. Omitted or false, a file already there is never written over. |
Returns
Dict{String,Any} — the tool’s answer as a Dict.
What it answers
Answers the file and its state.
Example
client.indicator.install("docs_sma.assay", "//@version=6\nindicator(\"Docs SMA\", overlay=true)\nplot(ta.sma(close, 20))\n")read#
Read a study script's text · tool indicator_read
Answers the text of one script in the person's indicators folder - an Assay script or a Python study - with its state as indicators_state lists it: what the Assay editor opens. Only a file of that folder is read; a script from elsewhere is handed to script_check and indicator_install as text.
Declaration
client.indicator
read(file)Parameters
| Name | Type | What it is | |
|---|---|---|---|
file | any | required | The script's file name in the indicators folder, with its extension: my_rsi.assay or my_sma.py. |
Returns
Dict{String,Any} — the tool’s answer as a Dict.
What it answers
Answers the text of one script in the person's indicators folder - an Assay script or a Python study - with its state as indicators_state lists it: what the Assay editor opens.
Example
client.indicator.read("…")rescan#
Read the indicators folder again · tool indicator_rescan
Reads the person's indicators folder again, as Settings › Indicators' Rescan does: each script that may run describes itself, and indicators_state reads the outcome once it lands.
Declaration
client.indicator
rescan()It takes no arguments.
Returns
Dict{String,Any} — the tool’s answer as a Dict.
What it answers
What the tool's description says.
Example
client.indicator.rescan()script_check#
Check an Assay script · tool script_check
Compiles an Assay script under Settings › Assay's settings and derives the custom study it would be, writing nothing; budgets says the steps a bar, bars back, array elements, string characters and nesting it runs under, and what a trial run over 500 synthetic bars used of them (whether it ran, its fault, the most steps a bar took and its share of the budget). Answers every finding with its line and column (kind: error, refused, later, reads the future), the notes on calls that run as no-ops, and either the study's custom_study_spec or the reasons it cannot be one, each at its place; and the compatibility report: how many built-ins it names and every place that does not simply run (each finding, and each built-in that diverges, with what it computes differently), as the Assay editor exports it.
Declaration
client.indicator
script_check(source; name = nothing)Parameters
| Name | Type | What it is | |
|---|---|---|---|
source | any | required | The script's whole text; it begins //@version=5 or //@version=6. |
name | any | optional | The file's stem the study's id is made from; omitted, the id is script_<8 hex> of the text. |
Returns
Dict{String,Any} — the tool’s answer as a Dict.
What it answers
Recorded from a running Bentrix 0.1.382 on a laboratory of generated markets (long lists cut to their first rows):
{
"budgets": {
"limits": {
"max_array": 100000,
"max_bars_back": 5000,
"max_nesting": 60,
"max_string": 4096,
"steps_per_bar": 2000000
},
"trial": {
"bars": 500,
"fault": null,
"peak_steps_per_bar": 19,
"ran": true,
"share_of_budget": 0.0
}
},
"compatibility": {
"builtins": 3,
"rows": [],
"runs": true
},
"compiles": true,
"diagnostics": [],
"notes": [],
"refusals": [],
"spec": {
"about": "",
"family": "oscillator",
"id": "script_093b8749",
"lines": [
{
"name": "plot_0",
"plot": "line"
}
],
"lookback": 1,
"scale": "auto",
"schema_version": 1,
"title": "t"
},
"version": {
"declared": 6,
"served": 6
}
}Example
client.indicator.script_check("//@version=6\nindicator(\"t\")\nplot(ta.sma(close, 20))\n")script_complete#
Complete an Assay script at a place · tool script_complete
Answers what may be typed at line and col of an Assay script, best first, in the text's own version (a version-4 text is offered version 4's names, each with what it is read as): each item's label, kind, signature or type, note, the text it inserts, whether it runs here, and whether it is Assay's own; and the span the items replace. Writes nothing.
Declaration
client.indicator
script_complete(source, line, col)Parameters
| Name | Type | What it is | |
|---|---|---|---|
source | any | required | The script's whole text, in any version 1 to 6 or with no version line. |
line | any | required | The line, from 1. |
col | any | required | The column, from 1, in characters. |
Returns
Dict{String,Any} — the tool’s answer as a Dict.
What it answers
Answers what may be typed at line and col of an Assay script, best first, in the text's own version (a version-4 text is offered version 4's names, each with what it is read as): each item's label, kind, signature or type, note, the text it inserts, whether it runs here, and whether it is Assay's own; and the span the items replace.
Example
client.indicator.script_complete("…", 1, 1)script_convert#
Convert an Assay script to a newer version · tool script_convert
Answers an older script (version 1 to 4, or no version line) written in version 5 or 6 - the text and the edits that make it, one a changed run of lines - as the IDE's Convert command shows it in a diff: the version pass's own reading written onto the source, every comment and the layout kept, computing what the original computes. Refused by name where an edit in place cannot say it (a script declaring its own ta, a strategy's when inside an expression) and for a conversion down. Writes nothing; the agent applies the edits or not.
Declaration
client.indicator
script_convert(source, to)Parameters
| Name | Type | What it is | |
|---|---|---|---|
source | any | required | The script's whole text, version 1 to 4 or with no version line. |
to | any | required | The version it is written in: 5 or 6. |
Returns
Dict{String,Any} — the tool’s answer as a Dict.
What it answers
Answers an older script (version 1 to 4, or no version line) written in version 5 or 6 - the text and the edits that make it, one a changed run of lines - as the IDE's Convert command shows it in a diff: the version pass's own reading written onto the source, every comment and the layout kept, computing what the original computes.
Example
client.indicator.script_convert("…", 1)script_definition#
Where an Assay script declares a name · tool script_definition
Answers the span where the script declares the name at line and col; null for a built-in or no name. Writes nothing.
Declaration
client.indicator
script_definition(source, line, col)Parameters
| Name | Type | What it is | |
|---|---|---|---|
source | any | required | The script's whole text, in any version 1 to 6 or with no version line. |
line | any | required | The line, from 1. |
col | any | required | The column, from 1, in characters. |
Returns
Dict{String,Any} — the tool’s answer as a Dict.
What it answers
Answers the span where the script declares the name at line and col; null for a built-in or no name.
Example
client.indicator.script_definition("…", 1, 1)script_folds#
Where an Assay script folds · tool script_folds
Answers each run of lines that folds: the line that stays shown and the last line it hides. Writes nothing.
Declaration
client.indicator
script_folds(source)Parameters
| Name | Type | What it is | |
|---|---|---|---|
source | any | required | The script's whole text, in any version 1 to 6 or with no version line. |
Returns
Dict{String,Any} — the tool’s answer as a Dict.
What it answers
Answers each run of lines that folds: the line that stays shown and the last line it hides.
Example
client.indicator.script_folds("…")script_format#
Format an Assay script · tool script_format
Answers the script's text formatted as the IDE's Format makes it, and the edits that make it: whitespace moved and nothing else - no name rewritten, the version line unchanged. Writes nothing.
Declaration
client.indicator
script_format(source)Parameters
| Name | Type | What it is | |
|---|---|---|---|
source | any | required | The script's whole text, in any version 1 to 6 or with no version line. |
Returns
Dict{String,Any} — the tool’s answer as a Dict.
What it answers
Answers the script's text formatted as the IDE's Format makes it, and the edits that make it: whitespace moved and nothing else - no name rewritten, the version line unchanged.
Example
client.indicator.script_format("…")script_history_list#
An Assay script's kept versions · tool script_history_list
Answers the versions the IDE kept of one script of the indicators folder, newest first: each one's id, when (UTC), what took it (save, run, format, convert, restore), the lines it added and removed against the one before, and its label. Writes nothing.
Declaration
client.indicator
script_history_list(file)Parameters
| Name | Type | What it is | |
|---|---|---|---|
file | any | required | A script of the indicators folder, by its file name (rsi_divergence.assay) or its stem. |
Returns
Dict{String,Any} — the tool’s answer as a Dict.
What it answers
Answers the versions the IDE kept of one script of the indicators folder, newest first: each one's id, when (UTC), what took it (save, run, format, convert, restore), the lines it added and removed against the one before, and its label.
Example
client.indicator.script_history_list("…")script_history_read#
Read one kept version of an Assay script · tool script_history_read
Answers the text of one version the IDE kept of a script, exactly as it stood. Writes nothing; an agent that wants it back installs it with indicator_install.
Declaration
client.indicator
script_history_read(file, id)Parameters
| Name | Type | What it is | |
|---|---|---|---|
file | any | required | A script of the indicators folder, by its file name or its stem. |
id | any | required | A version's id, as script_history_list answers it. |
Returns
Dict{String,Any} — the tool’s answer as a Dict.
What it answers
Answers the text of one version the IDE kept of a script, exactly as it stood.
Example
client.indicator.script_history_read("…", "…")script_hover#
What a name in an Assay script is · tool script_hover
Answers what the name at line and col of an Assay script is: its span, its title (a built-in's signature, or how the script declares it), its note, whether it runs here, what a version 1-4 name is read as, and whether it is Assay's own; null where no name stands there. Writes nothing.
Declaration
client.indicator
script_hover(source, line, col)Parameters
| Name | Type | What it is | |
|---|---|---|---|
source | any | required | The script's whole text, in any version 1 to 6 or with no version line. |
line | any | required | The line, from 1. |
col | any | required | The column, from 1, in characters. |
Returns
Dict{String,Any} — the tool’s answer as a Dict.
What it answers
Answers what the name at line and col of an Assay script is: its span, its title (a built-in's signature, or how the script declares it), its note, whether it runs here, what a version 1-4 name is read as, and whether it is Assay's own; null where no name stands there.
Example
client.indicator.script_hover("…", 1, 1)script_inspect#
Run an Assay script recorded, as the IDE's Run and inspect does · tool script_inspect
Runs a script over a workbench's bars of one market and interval, up to its cursor and never past it (the newest 5000), recorded as the IDE's Run and inspect records it, and answers: how many bars were read, each asked bar's named values at its close and the lines that ran in it (a bar outside the kept 5000 or past the bars read is refused), the bars where each stop fired, the script's log, its fault, and its lines by steps. Runs nothing on a chart and writes nothing.
Declaration
client.indicator
script_inspect(source, bench, symbol, timeframe; bars = nothing, stops = nothing)Parameters
| Name | Type | What it is | |
|---|---|---|---|
source | any | required | The script's whole text. |
bench | any | required | The workbench's uri, as get_state gives it. |
symbol | any | required | One of the workbench's markets. |
timeframe | any | required | An interval's label: M1, H4, D1. |
bars | any | optional | The bars whose rows are answered, by their place from 0 (the oldest read); omitted, the last. |
stops | any | optional | Stops, as the IDE's F9 puts them: the bars where each fired are answered. |
Returns
Dict{String,Any} — the tool’s answer as a Dict.
What it answers
What the tool's description says.
Example
client.indicator.script_inspect("…", bench, "SYN-DOCS", "H1")script_references#
Every place an Assay script reads a name · tool script_references
Answers every span where the script reads the name at line and col (its own name, in its own scope), the declaration among them unless include_declaration is false. Writes nothing.
Declaration
client.indicator
script_references(source, line, col; include_declaration = nothing)Parameters
| Name | Type | What it is | |
|---|---|---|---|
source | any | required | The script's whole text. |
line | any | required | The line, from 1. |
col | any | required | The column, from 1, in characters. |
include_declaration | any | optional | Whether the declaration is among the answers; true when omitted. |
Returns
Dict{String,Any} — the tool’s answer as a Dict.
What it answers
Answers every span where the script reads the name at line and col (its own name, in its own scope), the declaration among them unless include_declaration is false.
Example
client.indicator.script_references("…", 1, 1)script_rename#
Rename a name an Assay script declares · tool script_rename
Answers the edits that rename the script's own name at line and col to new_name everywhere it is read in its scope, or refuses by name (a built-in, a name already taken there, a name that is not one). Answers edits and writes nothing; the agent applies them or not.
Declaration
client.indicator
script_rename(source, line, col, new_name)Parameters
| Name | Type | What it is | |
|---|---|---|---|
source | any | required | The script's whole text. |
line | any | required | The line, from 1. |
col | any | required | The column, from 1, in characters. |
new_name | any | required | The name it is given. |
Returns
Dict{String,Any} — the tool’s answer as a Dict.
What it answers
Answers the edits that rename the script's own name at line and col to new_name everywhere it is read in its scope, or refuses by name (a built-in, a name already taken there, a name that is not one).
Example
client.indicator.script_rename("…", 1, 1, "…")script_signature#
The call an Assay script's place stands in · tool script_signature
Answers the call that line and col of an Assay script stands inside: the callee as written, its signature, its parameters with their types, which one is being typed, its note and what a version 1-4 name is read as; null where the place is in no call. Writes nothing.
Declaration
client.indicator
script_signature(source, line, col)Parameters
| Name | Type | What it is | |
|---|---|---|---|
source | any | required | The script's whole text, in any version 1 to 6 or with no version line. |
line | any | required | The line, from 1. |
col | any | required | The column, from 1, in characters. |
Returns
Dict{String,Any} — the tool’s answer as a Dict.
What it answers
Answers the call that line and col of an Assay script stands inside: the callee as written, its signature, its parameters with their types, which one is being typed, its note and what a version 1-4 name is read as; null where the place is in no call.
Example
client.indicator.script_signature("…", 1, 1)script_symbols#
An Assay script's outline · tool script_symbols
Answers the outline the IDE shows: the declaration, the inputs, the functions with their parameters, the types and enums, and the outputs by title, each with its span and kind, nested. Writes nothing.
Declaration
client.indicator
script_symbols(source)Parameters
| Name | Type | What it is | |
|---|---|---|---|
source | any | required | The script's whole text, in any version 1 to 6 or with no version line. |
Returns
Dict{String,Any} — the tool’s answer as a Dict.
What it answers
Answers the outline the IDE shows: the declaration, the inputs, the functions with their parameters, the types and enums, and the outputs by title, each with its span and kind, nested.
Example
client.indicator.script_symbols("…")script_vocabulary#
A version's own words · tool script_vocabulary
Answers a version's keywords and, for versions 1 to 4, every name that version writes bare and what it is read as (sma read as ta.sma, study as indicator). Writes nothing.
Declaration
client.indicator
script_vocabulary(version)Parameters
| Name | Type | What it is | |
|---|---|---|---|
version | any | required | A version, 1 to 6. |
Returns
Dict{String,Any} — the tool’s answer as a Dict.
What it answers
Answers a version's keywords and, for versions 1 to 4, every name that version writes bare and what it is read as (sma read as ta.
Example
client.indicator.script_vocabulary(1)