跳到主要内容

交易相关

    // 买卖点
this.chartInstance.updateTradeRecordData(
[
{
"amount": "0.00270442",
"create_time": 1678693751,
"id": 3210160,
"op": "",
"order_id": "555417080913731584",
"order_type": "limit",
"price": 18488.2,
"side": "buy",
"trade_type": "spot",
"type": "bid",
"tick": Date.now()
},
]
);

// 委单线
this.chartInstance.updateOrderLineData([{
oid: 'xxxxx', // 订单ID
name: '限价',
price: 29750,
infoText: '我是委单线',
trigger: 'Trigger >= 29750', // 可能会为空
amount: '100', // 数量
type: 'Limit', // 限价Limit、止损Stop
side: 'sell', // 买入buy、卖出sellk,
id: '111',
}]);

// 持仓成本线
this.chartInstance.updatePositionCostLineData(
[{
profit: -100.0018, // 持仓收益
profitRatio: -100.42, // 收益率(即10%)
pos: 1000, // 持仓数量
unit: '张', // 持仓数量单位
side: 'long', // 多空方向(long 多仓,short 空仓)
price: 19520, // 开仓价格
test: 123,
id: 'good',
},
]
);