Scripting (custom indicators and strategies)
Scripting, in a trading platform, is writing your own indicators and strategies in code so they run on the platform's data instead of being limited to the built-in catalogue. An indicator returns values to draw on the chart; a strategy returns decisions that drive a simulated account, a replay, a backtest or, where permitted and explicitly armed, live orders.
Senzoukria · Glossary · Updated September 2026
Indicators and strategies are different scripts
An indicator script receives bars and returns one or more series, drawn on the chart or in its own pane. A strategy script receives the same data and returns a decision per closed bar: buy, sell, flatten or nothing. The distinction matters because a strategy has consequences beyond the screen: it can drive a simulated account, be backtested over history, or reach a broker through an automation path that must be separately permitted.
What orderflow scripting gives you as input
- Per price level inside each bar: volume at the bid, volume at the ask, and their delta (ask volume minus bid volume).
- Imbalances, computed diagonally in the ATAS convention, comparing ask volume at one price to bid volume one tick below.
- Bar OHLC, timestamps and session boundaries, which alone would only allow classic candle indicators.
- Absent data stays absent: a level with no recorded trades is not zero volume, and a script should treat it that way.
Sandboxing and its limits
Running user code inside a trading application is a security question before it is a feature. A sandboxed runtime has no network, no file access and no direct broker API; it receives data, returns values and is killed if it runs too long. The cost is that a script cannot fetch external data or write files; the benefit is that a bug in a script cannot take the application down or send an order by accident.
In Senzoukria
The Scripting page ("Write your own indicators and fully automated strategies. Everything runs sandboxed on this machine — no network, no file access, no broker API.") separates "Indicators" from "Auto strategies", with "New indicator" and "New strategy" buttons, an editor, "Run on sample data" (Ctrl+Enter) and templates: EMA ribbon, Session cumulative delta, Buy imbalances, Session high / low, ATR percentage and a Breakout strategy. Languages are JavaScript, Python on a bundled interpreter, and C++17 compiled by Clang to WebAssembly. Scripts run in an isolated worker with a two-second budget; an infinite loop kills its own worker, never the app. A strategy trades the simulated evaluation account by default; historical backtests support JavaScript and Python, while C++ runs as indicators and in replay. Live execution exists only through the separate Autopilot panel, on a compatible Rithmic account, after you arm it yourself. An assistant using your own API key can write or edit a script from a description or a screenshot.
Common mistakes
- Treating a script that runs without errors on sample data as a tested strategy.
- Reading a missing level as zero and computing imbalances against it.
- Assuming the language choice does not matter; backtest and replay paths differ by language.
- Expecting a script to place orders; the script returns decisions, the platform and its permissions decide what happens next.
Related
- Quant trading for beginners
- Futures backtesting guide
- Bar delta indicator
- Order flow imbalance
- Autopilot
This page in other languages
Frequently asked questions
- Which language should I use for a trading script?
- Pick the language for the operation you need. In Senzoukria, JavaScript and Python strategies have historical backtest paths; C++ runs as indicators and in replay through its WebAssembly runtime but has no historical backtest. For a first indicator, the language you already read comfortably is the right one.
- Can a script send orders to my broker?
- Not directly. A strategy script returns decisions; by default they drive a simulated account, a replay or a backtest. Reaching a broker requires the platform's separate automation path, a compatible connected account with automation permission, and explicit arming by the trader.
- Why does my indicator return nothing?
- Usually because the script expects a field that is absent for the sample or the feed, returns the wrong shape, or exceeds the execution budget. Run it on sample data first to surface syntax errors and missing fields, then check the data the chart actually holds before suspecting the formula.