Scripting page overview

The Scripting page is where you write your own indicators and automated strategies. It holds the script list, the identity strip, the editor, the run bar, the output console and a reference column.

Senzoukria · Documentation · Updated September 2026


Where to find it

Where
Main menu → Scripting
Page subtitle
"Write your own indicators and fully automated strategies. Everything runs sandboxed on this machine — no network, no file access, no broker API."
Run budget
2 seconds per execution, in an isolated worker
Sample run
300 synthetic bars, tick size 0.25
Storage
Scripts are kept locally under the key orderflow.userIndicators.v1

What it does

Each zone of the page answers one question: the list says which script you are working on, the identity strip says what it is called, where it draws and in which language, the editor says what it does, the run bar acts, and the console and sketches say what the last run produced.

Between the identity strip and the code sits a one-line ribbon with four steps — Write, Check, Run, Result — each showing its real state rather than an idealised path. Write is "Saved" or "Unsaved changes". Check reports "JavaScript, no engine needed", the engine phase for Python, or "Code looks like Python" when the code contradicts the declared language. Run is "Not run yet", "Running…", a duration and bar count, or a failure with its line. Result reports the outputs, the strategy decision, or the error with its log counts.

Controls

The page's real controls and their defaults
ControlDefaultWhat it changes
New indicatorCreates a script whose compute() returns drawable outputs.
New strategyCreates a script whose decide() returns a trading decision for the simulated account.
Start from a templateOpens the template gallery, filtered by the language of the script.
Scripts (list toggle)openCollapses the left-hand list to give the editor the width.
TargetOn the chart"On the chart" draws over the price; "Own pane" gives the script its own pane.
LanguageJavaScriptStored with the script. Switching does not translate the code.
Run on sample dataCtrl+EnterRuns the draft on 300 synthetic bars and fills the ribbon, sketches and console.
SaveCtrl+SThe button reads "Saved" when clean and "Save changes" when the draft is dirty.
Show on the charton for a new indicatorA freshly created indicator is already shown; the toggle adds or removes it from the Indicators panel, in the "My scripts" group.

How to use it

  • Start from a template rather than a blank file: each one shows a different access to the data — closes, delta, the session, the footprint level by level, an open position.
  • Run early and often. The run is local, deterministic and costs nothing.
  • Read the ribbon left to right when something feels wrong: it names the first step that is not in a good state.
  • Save before toggling "Show on the chart" — the chart reads the saved script, not the draft.

Limits and pitfalls

  • Scripts run in an isolated worker with a 2-second budget. An infinite loop kills its own worker, not the application.
  • A strategy trades the simulated evaluation account on this machine only; it can never reach a broker.
  • The sample data is a deterministic random walk, not a market. A run proves the code executes and returns the right shape, never that it is profitable.
  • The page stays mounted when you leave it, so returning is instant and a long assistant reply keeps streaming.

This page in other languages

Frequently asked questions

Where are my scripts stored?
In this machine's local storage, under orderflow.userIndicators.v1. They are not uploaded anywhere.
What does "Run on sample data" actually run on?
300 synthetic bars generated by a deterministic random walk, with a 0.25 tick size passed through the context. The same script run twice gives the same result.
Why is the ribbon's Check step red?
Either the declared language contradicts the code, or the engine for the declared language is missing or failed to start. The step names which.

Keep reading