Skip to content

Conversation

@hurradieweltgehtunter
Copy link

Summary

Improve values in TimePeriodChart

Solve the issue: freqtrade/freqtrade#11727

Quick changelog

  • Format relative profit as percentage

What's new

Before:
grafik

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:
grafik

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

@xmatthias
Copy link
Member

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 ...

Copy link
Member

@xmatthias xmatthias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Image

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):
image

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 ).

@hurradieweltgehtunter
Copy link
Author

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.

Background: I'm extrapolating my average daily relative profits to calculate estimated monthaly/yearly profits. using 3 digits is increasing the accurancy. But might be not that relevant. Aligning with general count of digits is an argument. Changed it to 2 digits.

If i look at the corresponding "preriod breakdown" table - it actually IS 3.68%.

Ok, newbie question incoming: How do I display that table!? that's new for me.

Numbers are all over the place (no longer right-aligned).

Numbers in the tooltip weren't right aligned. Screenshot before changes:
grafik
Not sure what you mean by that.

@xmatthias
Copy link
Member

from your screenshot:
image

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 😆 )
(number are bold, too - but adding a <strong> tag is a nitpick once alignment is somewhat right 😆)

Ok, newbie question incoming: How do I display that table!? that's new for me.

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").

@hurradieweltgehtunter
Copy link
Author

ok this is just some css coding.
grafik

Copy link
Member

@xmatthias xmatthias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't look bad (when it works) - but it's wrong for "abs" (here, you're really missing the x100).

image

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants