Documentation for Deptle Terminal.
Guides for setup, scripting, troubleshooting, and more.
Parameters
Parameter(...) declares an input the Optimizer can sweep. The annotation sets the kind: int for a whole number, float for a decimal.
defaultis required and must sit betweenminandmax.minandmaxset the sweep range. Both are optional: leave one out and it snaps todefault; leave out both and the parameter is fixed atdefaultand never swept.stepis the sweep increment. It defaults to 1 for whole numbers, and for decimals to the smallest step at your precision (0.01 at 2 decimal places).namesets the label in the Optimizer UI.- Write decimals as numbers (
0.05) or quoted strings ("0.05"), up to 8 decimal places. All values in a declaration share the finest precision used. - A decimal parameter reads back as a decimal and makes the arithmetic around it decimal. A parameter used as an indicator window or an array
sizemust be anintparameter withmin,default, andmaxall above 0.
Declarations are strict
Parameter, State, and Extra reject anything they do not recognise — a typo fails loudly.
- Every argument is a keyword (
default=20), not a bare value. - An unknown keyword is an error, with a did-you-mean hint for close misspellings.
**kwargs-style splats are not allowed.- A class field assigned from an unrecognised call is an error.
A bare annotation like x: int or a plain constant like x: int = 5 is inert: it does not become a strategy field. Only Parameter(...), State(...), Extra(...), and the indicator constructors create fields.
Scalar state
A single value that survives from one tick to the next.
count: int = State(default=0)for a whole number.avg: float = State(default=0.0)for a decimal (orState(default_f32=0.0)).- Assignments are type-checked; decimal state accepts numeric expressions and converts them in.
Array state
A fixed-length buffer you index into, kept between ticks — for rolling windows and indexed memory.
buf: list[int] = State(size=64, default=0)— sized by a whole-number literal.win: list[float] = State(size=fast, default=0.0)— sized from anintParameter(the buffer uses that parameter'smax).sizemust be a positive whole-number literal or the name of anintparameter.- Indexing is safe: negative indexes count back from the end, and out-of-range indexes snap to the nearest valid slot.
Extra read-only buffers
Extra(...) reads outside data — reference levels, precomputed series, cross-asset signals — that your strategy never changes.
- Annotate as
list[int]orlist[float]. Writing to an Extra is a compile error. binding=is optional. Leave it out and Deptle assigns the lowest free slot (2 or higher) in declaration order. Passbinding=to pin a slot — it must be 2 or higher and unique.- Read length with
len(self.name)and elements withself.name[i]. - A missing or empty buffer reads as 0 (or 0.0). Out-of-range indexes snap to the nearest element; negative indexes count from the end.
Multi-asset layout
Declare the asset layout up front when your strategy expects more than one market stream.
required_assets: int = N, whereNis between 1 and 32.asset_slots: list[str] = ["lead", "hedge", ...], with 1 to 32 named entries.- If you use both,
required_assetsmust equallen(asset_slots).
Names starting with deptle_bar_ are reserved. Duplicate field names, or two Extras pinned to the same binding, are compile errors.
If launch fails, include your loader version, OS, and latest crash log so support can reproduce the issue quickly.