You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With all the new changes since the last time I used this API, did Binance add any new functions to get the average price of a token bought by the user?
So if you bought 1 BTC at $100 and another one at $200, then the average price of your token, i.e. the unit price would be $150. From this you can calculate the PNL.
Or do they have a way to get the PNL for each token?
Thanks a lot in advance.
The text was updated successfully, but these errors were encountered:
orionflame
changed the title
Fixing the old code after updating to the latest API
Is there a way to get the average price of a token bought from the API
Dec 30, 2023
Formula is: total token2 / total token1 = avg price
eg: for ethbtc, total BTC traded / total ETH traded , and you get average price.
You can confirm it in Binance position history, it should be exactly the same average price than the result of the formula
Hi,
With all the new changes since the last time I used this API, did Binance add any new functions to get the average price of a token bought by the user?
So if you bought 1 BTC at $100 and another one at $200, then the average price of your token, i.e. the unit price would be $150. From this you can calculate the PNL.
Or do they have a way to get the PNL for each token?
Thanks a lot in advance.
The text was updated successfully, but these errors were encountered: