CLI Configuration
Strategy Config Files
Strategy configurations are JSON files. The tradectl init command generates a config.json:
json
{
"api": {
"provider": "Binance",
"key": "",
"secret": ""
},
"limits": {
"maxLossLimit": 50
},
"db": {
"path": "./data/orders.db"
},
"log": {
"path": "./logs",
"mode": "console_file",
"level": "info"
},
"monitor": {
"host": "0.0.0.0",
"port": 9100
},
"strats": [
{
"name": "my_strategy-01",
"type": "my_strategy",
"marketType": "LINEAR",
"isEmulator": true,
"pairs": ["BTCUSDT"],
"order_size": 0.1
}
]
}Top-Level Fields
| Field | Type | Description |
|---|---|---|
api.provider | string | Binance, Bybit, or Hyperliquid |
api.key | string | Exchange API key |
api.secret | string | Exchange API secret |
limits.maxLossLimit | number | Max loss before auto-stop (USD) |
db.path | string | Path for local orders SQLite database |
log.path | string | Directory for log files |
log.mode | string | console, file, or console_file |
log.level | string | debug, info, warn, error |
monitor.host | string | Monitor dashboard bind address |
monitor.port | number | Monitor dashboard port |
Strategy Entries (strats[])
| Field | Type | Description |
|---|---|---|
name | string | Unique instance name (used in logs and status) |
type | string | Strategy type (matches declare_strategy! name) |
marketType | string | LINEAR or INVERSE |
isEmulator | boolean | true for paper trading, false for live |
pairs | string[] | Trading pairs (e.g., ["BTCUSDT", "ETHUSDT"]) |
Any additional fields in a strat entry are passed to the strategy as parameters via Params.
Validate Config
Check a config file for errors without starting:
bash
tradectl config validate --config config.json
tradectl run --config config.json --dry-run