泪流满面,终于自己解决掉了,给大家分享一下修改后的代码:
def main():
for i in range(len(exchanges)):
exchanges[i].SetContractType("swap")
R = exchanges[i].GetRecords()
P = exchanges[i].GetPosition()
Log(R)
Log(P)
还是有问题,模拟回测选择币安交易所,分别是btc 与ETH交易对,程序只能获取btc行情数据,报错:品种订阅失败 ETH_USDT_Futures_Binance
我的程序如下:
def main():
exchange.SetContractType("swap")
for i in range(len(exchanges)):
R = exchanges[i].GetRecords()
P = exchanges[i].GetPosition()
account = exchange.GetAccount()
Log(R)
Log(P)
Log(account)