Documentation for Deptle Terminal.
Guides for setup, scripting, troubleshooting, and more.
Python DSL · Intro
Deptle strategies use a focused Python-style language built for reliable trading logic.
You write strategy logic in a familiar Python-like style, but only the supported trading subset is available.
If you use something unsupported, the editor stops early with a direct error instead of letting the strategy fail silently later.
By default, quantity (base) and price (price) use 8 decimal places.
Required Entry Point
Every strategy must implement on_tick(self, tick) and may optionally accept sys as the third argument.
- Supported signatures:
def on_tick(self, tick):ordef on_tick(self, tick, sys):. on_baris not supported. Configure feed aggregation in Optimizer UI and keep logic inon_tick.- If you need system fields (
sys.*) orsys.portfolio_*()helpers, includesysin signature.
Supported Control Flow
Stick to a small set of familiar Python statements.
if/elif/else.for i in range(...)with 1, 2, or 3 positional args.break,continue,pass,return Order.*(...).- Docstring expression statements are ignored.
while, for ... else, and unsupported statements fail compilation.
Typing & Numeric Model
Keep each value in one clear type and the DSL will stay predictable.
- Local variable type is fixed by first assignment and cannot later change.
- Set a variable before you read it on every possible path.
/is float division.//is integer/base floor division.- Boolean operators (
and,or,not) require bool operands; numeric truthiness is not used. int,float, and fixed-point quantity type (base) are tracked explicitly.
Important Unsupported Constructs
This is not full Python, so some familiar features are intentionally unavailable.
- Arbitrary imports and external Python libraries in strategy logic.
- General-purpose callables/lambdas/comprehensions/generators.
- Mutating
Extra(...)buffers (read-only by design). - Dynamic attribute access beyond recognized DSL objects (
tick,sys,self).
If launch fails, include your loader version, OS, and latest crash log so support can reproduce the issue quickly.