Script template gallery

"Start from a template" opens a gallery of runnable scripts, each showing a different access to the data. The gallery is filtered by the language of the script you are writing.

Senzoukria · Documentation · Updated September 2026


Where to find it

Where
Scripting page → "Start from a template"
Filtering
A template with no version in the chosen language is hidden rather than offered and failing
Coverage
Six indicators — one of them C++ only — and two strategies
Each one runs as written
No placeholder code and no pseudo-code

What it does

Facing an empty editor, the question is not how to write a moving average but what you are allowed to read. Each template answers that in runnable form: the closes, the delta, the session, the footprint level by level, an open position.

Where a template exists in both JavaScript and Python it carries the same name, the same description and the same output, so you can read the two versions side by side to learn the syntax. The gallery is not duplicated — it follows the language chosen in the identity strip.

The templates

Templates, their kind and the languages they exist in
TemplateDefaultWhat it changes
EMA ribbonOn the chartTwo moving averages over price — the smallest correct indicator. JavaScript and Python.
Session cumulative deltaOwn paneDelta summed from the CME session open, reset each day. JavaScript and Python.
Buy imbalancesOn the chartDiagonal imbalances read level by level from the footprint. JavaScript and Python.
Session high / lowOn the chartBoth extremes drawn as lines extending to the right. JavaScript and Python.
ATR percentageOwn paneVolatility relative to price, in its own pane. JavaScript and Python.
Breakout strategyOn the chartBuys a break of the N-bar high, fixed stop and target. Simulated account only. JavaScript.
Mean reversion under regime (HMM + Hurst)On the chartA hidden Markov model rules out the crisis regime, a z-score says when to enter, the Hurst exponent confirms. Python only — it needs numpy.
Moving average (C++)On the chartA 20-bar SMA in C++17 — the minimal of_compute. C++ only.

How to use it

  • Pick the template whose data access matches what you want to measure, not the one whose output looks closest — the access is the part that is hard to guess.
  • Change the parameters first and re-run: every template reads its settings from params with a literal default, which is the form the parameter reader recognises.
  • Keep the imbalance template around as a reference for reading footprint levels: it is the only one that walks the levels of each bar.

Limits and pitfalls

  • A template missing in your language simply does not appear. Offering it and letting it fail would be worse than not offering it.
  • The regime strategy exists only in Python because it needs numpy for a Baum-Welch pass and a rescaled-range computation; hand-writing it in JavaScript would be duplicated code with no benefit.
  • Templates are starting points, not validated strategies. Nothing in the gallery is a claim about profitability.

This page in other languages

Frequently asked questions

Why do I see fewer templates in Python than in JavaScript?
The gallery filters by language in both directions. The breakout strategy exists only in JavaScript, and the regime strategy only in Python, so each list is slightly different.
Does a template overwrite my current script?
A template fills the editor for the script you are creating. Save deliberately, and use New indicator or New strategy when you want to keep the one you already have.
Can I mix a template's Python code into a JavaScript script?
No — and the Check step will tell you: it detects when the code contradicts the declared language and offers to switch.

Keep reading