Documentation for Deptle Terminal.

Guides for setup, scripting, troubleshooting, and more.

Parameters

Use Parameter(...) for inputs you want to tune in the Optimizer.

  • Required keyword keys: default, min, max.
  • Optional keys: step (default 1), name (UI label).
  • Validation: min <= default <= max, step > 0.
parameters.py
1class ParamExample(Strategy):
2 fast: int = Parameter(default=20, min=2, max=200, step=1, name="Fast Window")
3 slow: int = Parameter(default=100, min=10, max=500, step=5)
4
5 def on_tick(self, tick):
6 return Order.Hold()

Scalar State

Use scalar state when you want one value to survive from one event to the next.

  • x: int = State(default=0).
  • y: float = State(default=0.0) or State(default_f32=0.0).
  • Assignments are type-checked; float state accepts numeric expressions via cast.

Array State

Use array state for rolling buffers and indexed memory that should persist between events.

  • arr: list[int] = State(size=64, default=0).
  • arr_f: list[float] = State(size=my_param, default=0.0).
  • size must be a positive int literal or parameter name.
  • Indexing supports negative offsets and saturates out-of-range indexes to nearest valid element.
state_arrays.py
1class ArrayState(Strategy):
2 n: int = Parameter(default=16, min=4, max=128)
3 buf: list[int] = State(size=n, default=0)
4 idx: int = State(default=0)
5
6 def on_tick(self, tick):
7 self.buf[self.idx] = tick.price
8 self.idx = (self.idx + 1) % self.n
9 return Order.Hold()

Extra Read-Only Buffers

Use Extra(...) when you want to read outside data without modifying it from strategy code.

  • Supported types: list[int] and list[float].
  • Binding must be >= 2 (0/1 reserved).
  • Use len(self.extra_name) and self.extra_name[i] for reads.
  • Writes are forbidden (compile error).

Asset Topology Declarations

Declare the asset layout up front when your strategy expects more than one market stream.

  • required_assets: int = N where N is in [1, 32].
  • asset_slots: list[str] = ["lead", "hedge", ...] with 1..32 entries.
  • If both are present, required_assets must equal len(asset_slots).

Names with prefix deptle_bar_ are reserved; duplicate field names or duplicate extra bindings are compile errors.

Need help?

If launch fails, include your loader version, OS, and latest crash log so support can reproduce the issue quickly.

Check service status