输入/搜索内容
内置函数
结构体
Ticker
Depth
OrderBook
Trade
Record
Market
Order
Condition
Account
Asset
Position
Funding
其它结构
HttpQuery-options
HttpQuery-return
LogStatus-table
LogStatus-btnTypeOne
LogStatus-btnTypeTwo
状态栏组件
grid
tabs
kpi
stat
progress
gauge
sparkline
chart
heatmap
calendar
histogram
pie
timeline
markdown
alert
badge
Chart-options
Chart-return
KLineChart-options
KLineChart-return
SetData-data
EventLoop-return
exchange.Go-return
DBExec-return
Dial-return
Thread.join-return
内置变量与常量
通用约定
交易所

键值列表:一组「名称—数值」,适合账户余额、冻结资金、杠杆、强平价等明细。

示例

两列显示账户的可用资金、冻结资金和更新时间。

javascript
function main() { var account = exchange.GetAccount() if (!account) return var f2 = {precision: 2} LogStatus({type: "stat", title: "账户", cols: 2, items: [ {label: "可用", value: account.Balance, unit: "USDT", format: f2}, {label: "冻结", value: account.FrozenBalance, unit: "USDT", format: f2}, {label: "更新时间", value: _D()} ]}) }
python
def main(): account = exchange.GetAccount() if not account: return f2 = {"precision": 2} LogStatus({"type": "stat", "title": "账户", "cols": 2, "items": [ {"label": "可用", "value": account["Balance"], "unit": "USDT", "format": f2}, {"label": "冻结", "value": account["FrozenBalance"], "unit": "USDT", "format": f2}, {"label": "更新时间", "value": _D()} ]})
rust
fn main() { let Ok(a) = exchange.GetAccount() else { return }; let item = |label: &str, v: f64| format!( r#"{{"label": "{}", "value": {}, "unit": "USDT", "format": {{"precision": 2}}}}"#, label, v ); let items = [ item("可用", a.Balance), item("冻结", a.FrozenBalance), format!(r#"{{"label": "更新时间", "value": "{}"}}"#, _D(None)), ]; LogStatus!(format!( r#"{{"type": "stat", "title": "账户", "cols": 2, "items": [{}]}}"#, items.join(",") )); }

属性

名称类型描述

type

string

必填,固定为 stat。

items

object数组

必填。缺少 label 或 value 的项被跳过。

items[].label

string

必填。名称。

items[].value

number / string

必填。数值或文字。

items[].unit

string

单位。

items[].color

string

颜色:up、down、primary、warning、muted,见状态栏组件。

items[].format

object

数值格式 {precision, compact, percent},见状态栏组件。

items[].hint

string

数值后的补充说明。

cols

number

并排几列,1–4。默认 1。

title

string

标题,显示在组件左上角。

id

string

稳定标识。组件的个数或顺序会变化时设置,状态栏刷新时组件不重建。

span

number

在所在grid中占几列。默认 1。

参考