Harbor SDK
ui
rt.setUi draws strategy state on the instance. Pass a full description each time. The platform replaces the previous one.
| Field | Contents |
|---|---|
| cards | Metric cards. kind is metric, with id, label, and value |
| charts | A line. id, label, and points of time and value |
| fields | Read-only fields. id, label, and value |
| buttons | Buttons. id and label. danger: true asks the platform to confirm again |
The strategy supplies label and value. The platform does not translate copy the strategy wrote. Do not rely on button text alone for a dangerous action. A danger button gets a second confirmation.
rt.setUi({
cards: [{ kind: "metric", id: "px", label: "最新价", value: ticker.last }],
charts: [],
fields: [],
buttons: [{ kind: "button", id: "stop", label: "停止", danger: true }],
});