Language structure
LiSA Script strategies are JSON documents made of ordered rules. DCA currently uses version 2 and Trading uses version 5. Both require an explicit category and use separate validated contracts.
Shared fields
| Field | Purpose |
|---|---|
version | Category contract version: 2 for DCA and 5 for Trading. |
type | Must be "strategy". |
category | Must be "dca" or "trading". It is authored and not inferred from labels or actions. |
name | Human-readable strategy name. |
compact_description | Short card summary. |
description | Longer report description. |
labels | Required strategy classification IDs used on cards and by filters. |
market | Current market, currently "BTC". |
timeframe | Strategy timeframe. DCA uses "1d"; Trading accepts "1d" or "4h". |
execution | Simulated fill timing and cost assumptions. |
indicators | Built-in technical indicator declarations. |
rules | Ordered decision and action rules. |
constraints | Backtest start and end bounds. |
Names are the readable labels shown in reports. Hey-LiSA generates internal structural IDs for evaluation, traces, reports, and graph layout. LiSA Script does not accept authored rule, branch, IF, action, or condition IDs.
DCA category
A DCA strategy uses:
category: "dca"portfoliowith USDC starting cash- optional
external_series - DCA actions such as cashflow, buy, sell, and set
- direct actions, ordered actions, condition gates, branches, and nested IF rules
Every current DCA strategy includes the btc label and exactly one style label, dca or special. Optional study labels use stable IDs such as fear-greed-study.
"labels": ["btc", "dca", "fear-greed-study"] Trading category
A Trading strategy uses:
category: "trading"- an explicit
timeframeof"1d"or"4h" accountwith a positive USDC starting balanceopen_positionandclose_position- simple ordered rules containing named conditions and one named action
- optional ordered, named
exit_conditionsgroups written inline on anopen_position position_state()to require a flat, long, or short positionpercent_equitysizing with explicitleverage: 1, orrisk_percent_equity_at_stopsizing with leverage derived from the resolved stop
Every current Trading strategy includes btc, trading, and exactly one direction label: long, short, or long-short. Optional authored study labels use the same central label contract as DCA, and validated indicator reads add backend-derived indicator labels to cards and reports. The stop-loss review strategies use the stop-loss-suite study label.
Trading does not currently accept DCA portfolio fields, cashflows, external series, state variables, branches, or nested IF rules.
See Actions and execution for the category-specific action shapes.
DCA rule forms
| Form | Shape |
|---|---|
| Direct action | { "name", "action": { ... } } |
| Ordered actions | { "name", "actions": [{ ... }, ...] } |
| Condition gate | { "name", "conditions": [...], "action" or "actions" or "branches" } |
| IF tree | { "name", "if": { "name", "conditions", "then", "else" } } |
| Branch list | { "name", "branches": [{ "name", "when", ... }, { "name", "else": true, ... }] } |
Rule-level conditions can gate one action, ordered actions, or a branch list. IF targets can contain a nested IF, one action, or ordered actions. Branch lists execute the first matching branch. An else branch must be last.
Minimal DCA rule
{
"name": "Add daily contribution",
"action": {
"name": "Add daily contribution",
"type": "cashflow",
"amount": 50
}
}