0
Follow
1
Followers
getposition 함수는 첫 번째 계약 거래 쌍의 포지션 정보만 얻을 수 있습니다. for 루프를 사용하여 여러 거래 쌍의 포지션 정보를 동시에 얻을 수 있습니까?
Created 2021-10-16 21:24:27
14
1227
예를 들어, 제가 여러 쌍의 계약을 설정했을 때, getposition은 첫 번째 계약의 보유 정보를 얻을 수 있습니다. 다른 거래 쌍의 보유 정보를 어떻게 얻을 수 있습니까?
Related Recommendations
How to Specify Different Versions of Data for the Rented Strategy by Its Rental Code MetadataAdvanced Tutorial for FMZ Quant platform Strategy WritingElementary Tutorial for FMZ Quant platform Strategy WritingGet Started with FMZ Quant PlatformSECURITY BUGI keep getting error: Exchange_GetAccount: Invalid ContractTypeWe have an incredibly profitable market making algorithm for sideways markets on Bitmex - but need expert to help eliminate wait times during downward volatility in the marketError with deribitLimitations of the backtesting engineHow to install ta-lib on linux docker?
Comment
All comments (14)
泪流满面,终于自己解决掉了,给大家分享一下修改后的代码:
def main():
for i in range(len(exchanges)):
exchanges[i].SetContractType("swap")
R = exchanges[i].GetRecords()
P = exchanges[i].GetPosition()
Log(R)
Log(P)
5 years ago
javascript
function main() {
for (var i = 0 ; i < exchanges.length ; i++) {
var pos = exchanges[i].GetPosition()
Log(exchanges[i].GetName(), exchanges[i].GetCurrency(), "pos:", pos)
}
}
5 years ago
还是有问题,模拟回测选择币安交易所,分别是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)
5 years ago
- 1

