Type/to search
Built-in Functions
Structures
Ticker
Depth
OrderBook
Trade
Record
Market
Order
Condition
Account
Asset
Position
Funding
Other Structures
HttpQuery-options
HttpQuery-return
LogStatus-table
LogStatus-btnTypeOne
LogStatus-btnTypeTwo
Status Bar Components
Chart-options
Chart-return
KLineChart-options
KLineChart-return
SetData-data
EventLoop-return
exchange.Go-return
DBExec-return
Dial-return
Thread.join-return
Built-in Variables and Constants
Conventions
Exchanges

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

NameTypeDescription

type

string

Always button.

name

string

Text on the button.

cmd

string

Command sent to the strategy on click, read with GetCommand().

description

string

Hint shown on mouse hover.

disabled

bool

true disables the button.

class

string

Button style, for example "btn btn-xs btn-danger".

input

object

One input control opened on click: type, name, label, description, default, required, settings. The command is cmd:value.

group

array

A group of input controls opened on click; each item has the structure of input, and name is the key of the control in the command JSON. The command is cmd:JSON.

See Also