LogStatus-btnTypeTwo
This JSON structure is used to configure button controls in the status bar. The button control JSON structure can be embedded into the status bar table JSON structure. This is the latest version of the button JSON structure.
Status bar button control construction example (after the button is clicked, a popup contains multiple input controls, constructed through the group field):
json
{
"type": "button",
"cmd": "open",
"name": "Open Position",
"group": [{
"type": "selected",
"name": "tradeType",
"label": "Order Type",
"description": "Market order, Limit order",
"default": 0,
"group": "Trading Settings",
"settings": {
"options": ["Market Order", "Limit Order"],
"required": true,
}
}, {
"type": "selected",
"name": "direction",
"label": "Trade Direction",
"description": "Buy, Sell",
"default": "buy",
"group": "Trading Settings",
"settings": {
"render": "segment",
"required": true,
"options": [{"name": "Buy", "value": "buy"}, {"name": "Sell", "value": "sell"}],
}
}, {
"type": "number",
"name": "price",
"label": "Price",
"description": "Order price",
"group": "Trading Settings",
"filter": "tradeType==1",
"settings": {
"required": true,
}
}, {
"type": "number",
"name": "amount",
"label": "Order Amount",
"description": "Order quantity",
"group": "Trading Settings",
"settings": {
"required": true,
}
}],
}
The controls in the popup triggered by clicking the status bar button control are set through the input or group field.
Attributes
| Name | Type | Description |
type | string | For button controls, this field is fixed as: |
name | string | The text displayed on the button control, i.e., the button name. |
cmd | string | The interactive command content sent to the strategy when the button control triggers a click action. |
input | JSON | When constructing status bar buttons for interaction, input data is also supported. The interaction commands are ultimately captured by the Compared to the old version of the input structure, the new version adds some new fields and changes:
Description and explanation of each field in the above JSON structure:
|
group | array | The |
See Also
Remarks
Supports bilingual settings:
json
{
type:'selected',
name:'test',
label:'选项|options',
description:'描述|description',
default:0, // Here default value is set to 0, representing the value in {name:'xxx|yyy',value:0} option
filter:'a>1&&a<10',
group:'分组|group',
settings:{
multiple:true,
customizable:true,
options:[{name:'xxx|yyy',value:0}]
}
}