freqtrade / frequi

Freqtrade UI - Frontend for Freqtrade
https://github.com/freqtrade/freqtrade
GNU General Public License v3.0
574 stars 259 forks source link

FreqUI shows Wrong Balance #1205

Closed Mandark-droid closed 1 year ago

Mandark-droid commented 1 year ago

Describe the bug FreqUI is showing wrong balance on the UI.

Ok So I just started my first Live bot on Binance today and I already had some other tokens available in the wallet along with USDT before starting the BOT. But on FreqUI its showing the cumulative balance of all the tokens available in the Spot wallet and not of USDT which actually freqtrade is going to use for making the trades. Where as in Telegram /Balance command its giving the proper useable balance as 57$ which is correct. Ideally FreqUI should also show the balance of the actual usable currency that is configured in the config.json and not of all the assets available in ones Spot wallet.

To Reproduce Steps to reproduce the behavior:

  1. The balance shown on FreqUI is considering the balance of all the Coins held in the Spot wallet on binance.
  2. The Balance command on Telegram gives proper breakup of the balance. For Eg. my actual USDT balance is 57$ and the Telegram /balance command gives the proper breakup. Refer to the /balance command output below.
Starting capital: 57.007 USDT , 57.064 USD.
USDT:
 Available: 57.68553819
 Balance: 57.68553819
 Pending: 0.00000000
 Est. USDT: 57.686
TRX:
 Available: 22.27330090
 Balance: 22.27330090
 Pending: 0.00000000
 Est. USDT: 1.459
ADA:
 Available: 4.23705888
 Balance: 4.23705888
 Pending: 0.00000000
 Est. USDT: 1.656
CAKE:
 Available: 0.59097032
 Balance: 0.59097032
 Pending: 0.00000000
 Est. USDT: 2.005
32 Other Currencies (< 1.0 USDT):
 Est. USDT: 3.698

Estimated Value:
 USDT: 66.503 (16.66%)
 USD: 66.569 (16.66%)

Expected behavior

  1. Ideally FreqUI should only show the balance of the actual usable currency that is configured in the config.json and not of all the assets available in ones Spot wallet. Additionally when we have configured tradable_balance_ratio in the config.json the balance in the UI & Telegram should be shown based on that otherwise what's the point of this config param?
  2. Additionally the trading volume is also wrongly displayed please refer the screenshots provided below in the additional context section.

Screenshots Balance shown in FreqUI image Freqtrade Version image

Desktop (please complete the following information):

Additional context Additionally the trading volume is also showing wrong value. the Bot made 1 trade today with the Stake of 16$ but its showing trading volume as 34 $. image image

@xmatthias Can you please look into this? Let me know if you need any further info.

xmatthias commented 1 year ago

All screenshots seem to show the correct data of "USDT: 66.503" - which is also what the telegram output you provided shows.

I suspect you've missed the screenshot of the actual balance output - but based on the screenshots above, everything seems to be working as it should.

I also don't understand why you think trading volume would be wrong. You entered a trade with ~16.xx$ stake - and exited that trade again - which is another order, with another 16.xx$ of value - therefore the trade volume is ~34$ - which seems perfectly fine and correct if you ask me.

Mandark-droid commented 1 year ago

How is it correct data please explain when I had only 57$ of USDT which is going to be usable by the BOT to trade but its showing that I have 66$ of usable USDT for the bot to trade which is wrong representation of the data. Now lets say I have some other assets in my wallet for example ETH/BTC and the price for that rises then it will show a much higher value of balance which is usable by the bot in reality its not true. The net usable balance available to the BOT in USDT still remains the same.

xmatthias commented 1 year ago

The shown balance is aligned with the output of estimated balance in the telegram output.

This is intentional and aligned to the output of telegram - and is showing you the balance of this account. It'll also include the balance of all open trades - not just the balance that'd be available to open new trades.

To see the exact counterpart of the /balance output, best use the "balance" tab in the general overview.

Mandark-droid commented 1 year ago

Not convinced with your response. As the config params "stake_currency" and "tradable_balance_ratio" for the staked currency is based on which you should be displaying the balance available to the BOT and not the complete balance of the account. Also the profit ratio/% shown right now in the UI is based on the complete account balance and not on the bases of the Amount that is allocated to the BOT to trade. I may have 10K in my account but I have allocate only 1K to the bot then I expect it to show only 1K and the profits also based on the 1K stake that is allocated to the BOT.

This is my actual balance. image

Now I just moved 1 ETH into my SPOT wallet but I have not configured the BOT to use ETH as stake currency but its now showing me total balance along with ETH as 1900$ where as the actual balance available to the BOT is still the name. Also now with 1 ETH added to the SPOT wallet its showing wrong closed profit %. image

Telegram breakup.

Starting capital: 57.576 USDT , 57.576 USD.
ETH:
 Available: 1.00007535
 Balance: 1.00007535
 Pending: 0.00000000
 Est. USDT: 1856.8
USDT:
 Available: 41.86820297
 Balance: 41.86820297
 Pending: 0.00000000
 Est. USDT: 41.868
TRX:
 Available: 22.27330090
 Balance: 22.27330090
 Pending: 0.00000000
 Est. USDT: 1.448
ADA:
 Available: 4.25260747
 Balance: 4.25260747
 Pending: 0.00000000
 Est. USDT: 1.642
CAKE:
 Available: 0.61081538
 Balance: 0.61081538
 Pending: 0.00000000
 Est. USDT: 2.053
HIFI:
 Available: 32.47100000
 Balance: 32.47100000
 Pending: 0.00000000
 Est. USDT: 15.391
32 Other Currencies (< 1.0 USDT):
 Est. USDT: 3.571

Estimated Value:
 USDT: 1922.773 (3239.53%)
 USD: 1922.773 (3239.53%)
Mandark-droid commented 1 year ago

Additionally this is really bad UI/UX because there should be consistency in the data that you are representing on the dashboard and it should show the same value across all pages/tabs of the dashboard/UI. Because when I go to Dashboard tab you show that available balance is 1900$ but when I go to the Trade Tab and select the Balance Sub-Tab it says you have only 57$ that's tradeable. Ideally I expect the Dashboard tab also to show the same value as shown in the Trade - Balance sub tab.

xmatthias commented 1 year ago

The UI is aligned to the data you see in telegram (it's therefore clearly not a bug).

if the display per se could be improved is a different topic - but it's not a UI topic directly - as the UI is just another view at the same data - so if it's aligned to the telegram output (which it is) - it's working as expected.

What you expect to see clearly will depend on the expectations. It can also be considered a bug to just show you 100$ - even though the account really has 1000$ in it.

You're more than welcome to submit a PR improving this (starting with the telegram part, which will most likely automatically also improve the display for the rest) if you think this should be changed / improved, but i'd keep it optional (so the full account view is still available). It's however not an issue for freqUI - which is just displaying what the bot provides - and is displaying that correctly, aligned to telegram output.

Mandark-droid commented 1 year ago

@xmatthias Thank you for the new build now the data is represented correctly this is good work thanks again.