LogStatus-btnTypeTwo
状态栏按钮的JSON结构(当前写法,输入控件带settings)。按钮可以直接输出到状态栏,也可以放进状态栏表格的单元格。字段、命令格式与settings的完整说明见LogStatus的「状态栏按钮」。
例如点击后弹出一组输入控件的按钮(price只在选择限价单时显示),点击确定后GetCommand()收到open:{"tradeType":1,"direction":"buy","price":60000,"amount":1}:
json
{
"type": "button",
"cmd": "open",
"name": "开仓|Open",
"group": [{
"type": "selected",
"name": "tradeType",
"label": "下单类型|Order type",
"default": 0,
"settings": {"options": ["市价单|Market", "限价单|Limit"]}
}, {
"type": "selected",
"name": "direction",
"label": "方向|Direction",
"default": "buy",
"settings": {"render": "segment", "options": [{"name": "买入|Buy", "value": "buy"}, {"name": "卖出|Sell", "value": "sell"}]}
}, {
"type": "number",
"name": "price",
"label": "价格|Price",
"required": true,
"settings": {"filter": "tradeType==1"}
}, {
"type": "number",
"name": "amount",
"label": "数量|Amount",
"required": true
}]
}
属性
| 名称 | 类型 | 描述 |
type | string | 固定为 |
name | string | 按钮上的文字。 |
cmd | string | 点击后发送给策略的命令,用 |
description | string | 鼠标悬停时显示的说明。 |
disabled | bool |
|
class | string | 按钮样式,例如 |
input | object | 点击后弹出的一个输入控件: |
group | array | 点击后弹出的一组输入控件,每一项与 |
参考