使用python运行exchange.GetPosition()函数,无法获取持仓信息,显示错误

Author: 蜜蜂爱吃肉, Created: 2021-10-16 16:34:40, Updated:

使用python运行getposition函数,显示错误如下: Traceback (most recent call last): File “<string>”, line 999, in init_ctx File “<string>”, line 41, in <module> File “<string>”, line 4, in main NameError: name ‘log’ is not defined

python 程序如下: def main(): exchange.SetContractType(“swap”) A = exchange.GetPosition() log(A)

参数设置为币安期货接口,BTC_USDT 请问这个问题出在了哪里?


More

小小梦 Log, 不是log.

蜜蜂爱吃肉 我用js写的程序就能获取持仓信息,代码如下: function main() { exchange.SetContractType("swap") while (1) { var a = exchange.GetPosition() var b =a.length Log(b) Log(a); } }