目录

基础命令

命令说明子命令
/help显示帮助信息-
/debug查看状态-
/strategy策略管理create, delete, pause, resume
/alert警报管理create, delete, empty, pause, resume

策略管理

策略类型说明

RestClient 策略

WebSocket 策略

策略示例

1. 现货做多策略 (OpenBuy)

/strategy create {
    "Symbol": "BTCUSDT",
    "Amount": 1000,
    "Volatility": 0.2,
    "Interval": "1d",
    "AccountType": "Spot",
    "AutoReset": false,
    "StopLossExpression": "close = 0",
    "StrategyType": "OpenBuy"
}

2. 合约做空策略 (OpenSell)

/strategy create {
    "Symbol": "BTCUSDT",
    "Amount": 1000,
    "Volatility": 0.2,
    "Interval": "1d",
    "AccountType": "Future",
    "AutoReset": false,
    "StopLossExpression": "close = 0",
    "StrategyType": "OpenSell"
}

3. WebSocket合约做空策略 (CloseSell)

/strategy create {
    "Symbol": "BTCUSDT",
    "Amount": 1000,
    "Volatility": 0.002,
    "Interval": "4h",
    "AccountType": "Future",
    "AutoReset": false,
    "StopLossExpression": "close = 0",
    "StrategyType": "CloseSell"
}

4. WebSocket合约做多策略 (CloseBuy)

/strategy create {
    "Symbol": "BTCUSDT",
    "Amount": 1000,
    "Volatility": 0.002,
    "Interval": "4h",
    "AccountType": "Future",
    "AutoReset": false,
    "StopLossExpression": "close = 0",
    "StrategyType": "CloseBuy"
}

5. 删除策略

/strategy delete <Id>

警报管理

支持的时间间隔

警报示例

1. 价格波动警报

/alert create {
    "Symbol": "BTCUSDT",
    "Interval": "4h",
    "Expression": "Math.abs((close - open) / open) >= 0.02"
}

2. 价格阈值警报

/alert create {
    "Symbol": "BTCUSDT",
    "Interval": "4h",
    "Expression": "close > 20000"
}

3. 删除指定警报

/alert delete <Id>

4. 清空所有警报

/alert empty