The Signal Language (DSL)
The Signal language is the optional code path beneath the interface. Most users build signals and backtests in the interface and never write a line of it. Reach for it when the form runs out of room: a cross-leg strike offset, a custom rolling statistic, two accessors combined on one spine.
One contract defines the whole language. A standalone program ends on a Signal-valued expression, which means its final expression references at least one accessor (bar.*, option.*, time.*, or signal(...)) somewhere in its ancestry. Read only that sentence and you can tell a valid program from an invalid one.
What a program looks like
This is the editor's default program, an intraday IV term-structure spread. It reads two IV Signals off the option accessor and subtracts them, so it ends on a Signal.
// Intraday IV term-structure spread: short-dated vs long-dated IV
iv_7 = option.iv(dte=7) // short-dated ATM IV
iv_30 = option.iv(dte=30) // medium-dated ATM IV
// Positive = normal term structure; negative = inverted (near-term stress)
iv_30 - iv_7Each option.iv(dte=...) call is a 1-minute series until you sample it to a coarser cadence.
The pages in this section
Each page teaches the language and its execution semantics, never options theory.
- The Signal language defines what a Signal is, the scalar-versus-Signal distinction, and the one rule that a program ends on a Signal.
- The execution model covers the union spine, backward as-of fill, point-in-time visibility, observation-count windows, and
nullversusNaN. - Data accessors tours the
bar,option, andtimeaccessors a standalone signal reads, plusoption.contract(...)for one real contract. - Operators and functions groups the roughly 70 callables by category: transforms, rolling aggregations, lag and change, missing-data handling, and the resampling builders.
- Writing and saving a signal covers evaluate versus save, the signal-library modal,
signal("slug")imports, and regeneration. - Signals inside a backtest covers the
book(),position(),leg("slug"), andoption.contract(...)accessors that read live engine state, and which slot each is legal in.
Where the Signal language connects
This section explains the language but does not enumerate every name. For the exhaustive per-function lookup, see the DSL operator and function catalog; for per-method signatures and defaults on the accessors, see the data accessor reference.
Every entry, exit, and trigger signal feeds a backtest, the terminal stage covered in the Backtests section. A standalone signal is evaluated and charted on the Signal tab in the Signal Analysis section.