The getposition function can only retrieve the holding information for the first contract transaction pair, ask if it is possible to use the for loop to get the holding information for multiple transaction pairs at the same time.
The getposition function can only retrieve the holding information for the first contract transaction pair, ask if it is possible to use the for loop to get the holding information for multiple transaction pairs at the same time.
Created: 2021-10-16 21:24:27,
Updated on:
14
618
The question is, when I set up multiple contract pairs and getposition only gets holdings for the first contract, how do I get holdings for the other pairs?
I've been crying and crying and finally solved it myself, so please share the modified code:
def main (:
for i in range (exchanges)):
This is a list of all the different ways Exchanges[i].SetContractType is credited in the database.
R = exchanges[i].GetRecords ((()
P = exchanges[i].GetPosition ((()
Log ((R)
Log ((P))
I may have found a bug, the same program, okx can read multiple transaction pairs of parameters, but on the binary exchange, it can only read the data of the first transaction pair.
There is also a problem, the analogue retest selects the binary exchange, respectively the BTC and the ETH trading pairs, the program can only get the BTC market data, error message: variety subscription failed ETH_USDT_Futures_Binance
My procedure is as follows:
def main (:
Exchange.SetContractType (swap) is the name of the exchange.
for i in range (exchanges)):
R = exchanges[i].GetRecords ((()
P = exchanges[i].GetPosition ((()
account = exchange.GetAccount
Log ((R)
Log ((P))
Log ((account))