0
Follow
1
Followers
Hàm getposition chỉ có thể lấy thông tin vị trí của cặp giao dịch hợp đồng đầu tiên. Tôi có thể sử dụng vòng lặp for để lấy thông tin vị trí của nhiều cặp giao dịch cùng lúc không?
Created 2021-10-16 21:24:27
14
1227
Ví dụ, khi tôi đặt nhiều cặp hợp đồng, và chỉ có thể lấy thông tin về vị trí của hợp đồng đầu tiên bằng cách sử dụng getposition, làm thế nào để có được thông tin về vị trí của các cặp khác?
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

