资源加载中... loading...

继续求教获取账户信息问题

Author: lzhqlj, Created: 2021-11-10 22:42:42, Updated:

OKEX模拟盘

模拟盘持仓信息 img

实盘配置了ETH img

代码如下 也设置了 模拟盘啥的 //设置为模拟仓 exchanges[0].IO(“simulate”, true) //设置为永续合约 exchanges[0].SetContractType(“swap”) // 读取当前行情信息 var ticker0 = exchanges[0].GetTicker() Log(“High:”, ticker0.High, “Low:”, ticker0.Low, “Sell:”, ticker0.Sell, “Buy:”, ticker0.Buy, “Last:”, ticker0.Last, “Volume:”, ticker0.Volume) var position0 = exchanges[0].GetPosition() if (position0.length > 0) { Log(“永续合约 exchanges[0] Amount:”, position0[0].Amount, “FrozenAmount:”, position0[0].FrozenAmount, “Price:”,position0[0].Price, “Profit:”, position0[0].Profit, “Type:”, position0[0].Type, “ContractType:”, position0[0].ContractType) } else { Log(“持仓为空”) } var account = exchange.GetAccount() Log(“账户信息,Balance:”, account.Balance, “FrozenBalance:”, account.FrozenBalance, “Stocks:”, account.Stocks, “FrozenStocks:”, account.FrozenStocks)

img 结果就是读不出来信息。。。。一直用币安,没用过OK 是ok下错单了吗?迷糊好几天了 求教哈 谢谢


More

lzhqlj 谢谢哈

发明者量化-小小梦 先弄明白币本位合约,U本位合约。平台的入门帖子看下。 https://www.fmz.com/digest-topic/6857

小草 ETH-USD 是币本位合约,设置为ETH_USDT交易对