LogStatus-btnTypeTwo
JSON structure of a status bar button (current form, with settings on input controls). A button can be output directly to the status bar or placed in a status bar table cell. The full description of the fields, the command format and settings is under "Status bar buttons" in LogStatus.
For example, a button that opens a group of input controls (price is shown only when a limit order is selected); after confirming, GetCommand() receives 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
}]
}
Attributes
| Name | Type | Description |
type | string | Always |
name | string | Text on the button. |
cmd | string | Command sent to the strategy on click, read with |
description | string | Hint shown on mouse hover. |
disabled | bool |
|
class | string | Button style, for example |
input | object | One input control opened on click: |
group | array | A group of input controls opened on click; each item has the structure of |
See Also