freqtrade / freqtrade

Free, open source crypto trading bot
https://www.freqtrade.io
GNU General Public License v3.0
28.65k stars 6.14k forks source link

Estimated Value and Profit percentage calculation is wierd when assets already exist in spot wallet #8532

Closed BurningSpy closed 1 year ago

BurningSpy commented 1 year ago

Describe your environment

Describe the problem:

Hi, So yesterday I first time started a bot on live binance. In my Telegram I can see when I checked the "/balance" right after startup, since I already had some coins like BAT and UFT lying around, it would see 211 BUSD as "Starting capital" and then at the end of the message added the other assets together for the estimated value of ~320.

So far so good, but after the first trade was done and it made 1.8 BUSD in that trade from a 1.2% profit trade, it then took the Starting capital BUSD of 211 and compared that to the new estimated value, showing an astounding 51.98% profit. Which doesn't make sense.

Wouldn't it be better for this scenario to use the estimated value at the start as the starting capital, if that is what we are comparing future values with?

I mean i'd love to have 52% profit, but i'd prefer that to be a real number :D

Steps to reproduce:

  1. Start bot on live with different coins already in wallet
  2. ask for balance
  3. wait for one trade
  4. ask for balance again

Observed Results:

Wrong profit percentage

Relevant code exceptions or logs

xmatthias commented 1 year ago

Nice spot - will have a look :+1: