show relative profit as correctly rounded percentage#2414
show relative profit as correctly rounded percentage#2414hurradieweltgehtunter wants to merge 7 commits intofreqtrade:mainfrom
Conversation
|
i wonder why formatting in your screenshot is that much different? Will have to take a closer look - but i'm pretty certain there's a 1/2 line fix this ... |
xmatthias
left a comment
There was a problem hiding this comment.
Unfortunately, this ain't fixing anything, really.
rounding a % value to 3 digits is pointless. we use 2 digits to format percentages throughout the bot - i don't see why this chart should be different.
If you made 0.001% profit - or 0.005% profit will not matter - neither will make you rich.
If i look at the corresponding "preriod breakdown" table - it actually IS 3.68%.
Why should the chart show even more (pointless) decimals?
In reality - i assume your bot simply only made 0.0x% profits - which might be rounded away.
But that's not wrong - we're talking about a 0.00x% profit here (otherwise there would be no rounding that makes it 0).
if i now use your new branch (same bot):

It's 3 digits now - where - honestly - 2 of which are pointless - as sub 0.1% profit deviations are irrelevant unless you're using millinons as stake (even then it's probably irrelevant to you 😆 ), but let's keep it at 2 to keep alignment.
Formatting of the tooltip however changed significantly - unfortunately, to the worse.
Numbers are all over the place (no longer right-aligned).
I'm happy with adding the "abs" value in the tooltip (the axis label should remain as is) if we can keep the formatting of the tooltip to have values right-aligned (decimals should be rounded to 2 ).
|
I call this "numbers ae right-aligned" (and that's what i mean) - or in css terms for a flexbox - it's "justify-between" (but not really, then the symbols would align, too 😆 )
Well that's the point / difficulty - and the reason I don't usually format the tooltip manually (if you look through the charts, we don't override tooltip.formatter anywhere as far as i know. It's the echarts default (if you don't implement the formatter property) - and so far, i wasn't able to identify HOW they format it this way (the docs only mention how to override it to look differently - not how to get it to the "same look but different content"). |
xmatthias
left a comment
There was a problem hiding this comment.
Doesn't look bad (when it works) - but it's wrong for "abs" (here, you're really missing the x100).
I think the point is the transform - which ain't applied if the dimension isn't profit_rel.
now you can't apply the transform unconditionally either though - as then we'd multiply all values - including the absolute profit.





Summary
Improve values in TimePeriodChart
Solve the issue: freqtrade/freqtrade#11727
Quick changelog
What's new
Before:

Relative profit is 8,8% but displayed as number 0.88.
Small relative profit values (< 0.01) were displayed as 0 due to rounding errors.
After:

Consolidated relative profit view with correctly rounded and displayed percentage numbers.