Raw schema
{
"type": "object",
"properties": {
"rule": {
"type": "object",
"description": "A trading rule in Dolphin's rule language - the same one the build chat writes and the live engine runs.",
"properties": {
"venue": {
"type": "string",
"enum": [
"binance-spot",
"binance-futures",
"binance-wallet",
"dolphin-wallet"
],
"description": "Where it trades. Shorts and leverage need binance-futures."
},
"market": {
"type": "string",
"description": "A Binance pair, e.g. \"BNBUSDT\", \"BTCUSDT\", \"CAKEUSDT\"."
},
"timeframe": {
"type": "string",
"enum": [
"1m",
"5m",
"15m",
"1h",
"4h",
"1d"
]
},
"action": {
"type": "string",
"enum": [
"buy",
"short"
],
"description": "How it enters. It sells through its exits."
},
"when": {
"type": "array",
"items": {
"type": "object",
"description": "One condition, judged on the last CLOSED candle. Kinds: rsi {op: above|below, value 1-99, period?=14}; price {op, value}; price_vs_ma {op, ma: sma|ema, length}; ma_cross {direction: up|down, fast, slow, ma?: sma|ema}; macd_cross {direction: up|down} (12/26/9); trend {direction: up|down, candles 1-20} (that many closes in a row each higher/lower); change_pct {op, value (% , negative for drops), candles}.",
"properties": {
"kind": {
"type": "string",
"enum": [
"rsi",
"price",
"price_vs_ma",
"ma_cross",
"macd_cross",
"trend",
"change_pct"
]
},
"op": {
"type": "string",
"enum": [
"above",
"below"
]
},
"direction": {
"type": "string",
"enum": [
"up",
"down"
]
},
"value": {
"type": "number"
},
"period": {
"type": "number"
},
"ma": {
"type": "string",
"enum": [
"sma",
"ema"
]
},
"length": {
"type": "number"
},
"fast": {
"type": "number"
},
"slow": {
"type": "number"
},
"candles": {
"type": "number"
}
},
"required": [
"kind"
]
},
"description": "Enter when ALL hold (1-6)."
},
"until": {
"type": "array",
"items": {
"type": "object",
"description": "One condition, judged on the last CLOSED candle. Kinds: rsi {op: above|below, value 1-99, period?=14}; price {op, value}; price_vs_ma {op, ma: sma|ema, length}; ma_cross {direction: up|down, fast, slow, ma?: sma|ema}; macd_cross {direction: up|down} (12/26/9); trend {direction: up|down, candles 1-20} (that many closes in a row each higher/lower); change_pct {op, value (% , negative for drops), candles}.",
"properties": {
"kind": {
"type": "string",
"enum": [
"rsi",
"price",
"price_vs_ma",
"ma_cross",
"macd_cross",
"trend",
"change_pct"
]
},
"op": {
"type": "string",
"enum": [
"above",
"below"
]
},
"direction": {
"type": "string",
"enum": [
"up",
"down"
]
},
"value": {
"type": "number"
},
"period": {
"type": "number"
},
"ma": {
"type": "string",
"enum": [
"sma",
"ema"
]
},
"length": {
"type": "number"
},
"fast": {
"type": "number"
},
"slow": {
"type": "number"
},
"candles": {
"type": "number"
}
},
"required": [
"kind"
]
},
"description": "Exit when ALL hold. May be empty if a stop-loss or take-profit is set."
},
"sizeUsd": {
"type": "number",
"description": "Dollars per entry, 1-100000."
},
"stopLossPct": {
"type": [
"number",
"null"
],
"description": "Exit at this % price move against the position."
},
"takeProfitPct": {
"type": [
"number",
"null"
],
"description": "Exit at this % price move in favour."
},
"leverage": {
"type": "number",
"description": "Futures only, 1-5. Above 3x comes with a liquidation warning."
},
"maxTradesPerDay": {
"type": "number",
"description": "Default 2."
},
"cooldownMinutes": {
"type": "number",
"description": "Wait after any trade before the next entry. Default 0."
},
"confirm": {
"type": [
"object",
"null"
],
"description": "Optional. Ask Jev (TypeSafe's decision model) to approve each buy on Dolphin, with the runner's own Jev key. Backtests skip it.",
"properties": {
"brain": {
"type": "string",
"enum": [
"jev"
]
},
"minPct": {
"type": "number",
"description": "How sure Jev must be, 50-95. Default 60."
}
},
"required": [
"brain"
]
}
},
"required": [
"venue",
"market",
"timeframe",
"action",
"when",
"sizeUsd"
]
},
"candles": {
"type": "number",
"description": "How much history, 100-1500 candles. Default 1000."
}
},
"required": [
"rule"
],
"additionalProperties": false
}