Guides

StrateScript developer guide

StrateScript is the scripting language built into Strate. You use it to write your own indicators, simulated strategies and studies, and run them on any chart. Scripts can read data at every level of detail:

This guide is for traders who want to write scripts themselves. You do not need to know Rust or any other particular language: if you have written a spreadsheet formula or a short script before, you have enough background. Strate AI can also write scripts for you, but nothing in this guide depends on it.

Every complete example in this guide passes the same check the app runs on your code before it executes. When an example says what it prints, that output was produced by the engine.

How to read this guide#

  1. Start with Getting started. It takes you from an empty editor to a named indicator saved in My indicators.
  2. Read The language once from top to bottom. It is the longest guide page, but it explains the few rules that differ from other languages: how variables are reset on each bar, and how na behaves.
  3. Then go to the topic you need. The reference pages are for looking things up.

Map of the guide#

PageWhat it covers
Getting startedFirst indicator, step by step: where to write code, checking, running, settings, saving to My indicators
The languageSyntax, script kinds, headers, types, variables, operators, control flow, functions, custom types, collections, history, budget
Market dataBars, footprint, sessions and hours, other timeframes and instruments, trades one by one, what is available in live, Replay and long backtests
Order flowOrder-by-order (MBO) events, the order book, level statistics, the of module, history windows, worked examples (absorption, iceberg refills, pulled liquidity)
Patterns, clocks and signalsEvent handlers, pattern blocks, custom clocks, on signal, the shipped pattern library
NormalizationThe norm module: comparing a measure with its own recent values (rank, z-score, ratio to median)
PlottingPlots, histograms, fills, levels, markers, labels, boxes, tables, cells in the bar column, colors, panes, scales
Settingsinput.* functions, the Settings tab, units (ticks, points), settings that pick a price or a time on the chart
Alertsalert(), how often it fires, sound and notifications, alerts in Replay
StrategiesSimulated orders, stops and targets, units, costs, fill models, latency, the Report, equity curve, CSV export, sweeps, long backtests, MBO start
ResearchMeasuring what happens after a signal: study(), report(), compare(), the research report
Reference: functionsEvery built-in function, field and method, with parameters, defaults and return values
Reference: errorsEvery error code, its message, cause and fix
Reference: limitsBounds, memory, performance, and what is not supported
ExamplesComplete, commented scripts, from a moving average to MBO absorption

Conventions used in this guide#

STRATE / PRODUCT SCREENSHOT

Actual platform screenshot.