Move formatting of /daily to telegram
so /daily can return numbers in the API
This commit is contained in:
parent
ce15c55185
commit
375e671aaf
@ -224,22 +224,20 @@ class RPC:
|
||||
]).order_by(Trade.close_date).all()
|
||||
curdayprofit = sum(trade.close_profit_abs for trade in trades)
|
||||
profit_days[profitday] = {
|
||||
'amount': f'{curdayprofit:.8f}',
|
||||
'amount': curdayprofit,
|
||||
'trades': len(trades)
|
||||
}
|
||||
|
||||
data = [
|
||||
{
|
||||
'date': key,
|
||||
'abs_profit': f'{float(value["amount"]):.8f}',
|
||||
'fiat_value': '{value:.3f}'.format(
|
||||
value=self._fiat_converter.convert_amount(
|
||||
'abs_profit': value["amount"],
|
||||
'fiat_value': self._fiat_converter.convert_amount(
|
||||
value['amount'],
|
||||
stake_currency,
|
||||
fiat_display_currency
|
||||
) if self._fiat_converter else 0,
|
||||
),
|
||||
'trade_count': f'{value["trades"]}',
|
||||
'trade_count': value["trades"],
|
||||
}
|
||||
for key, value in profit_days.items()
|
||||
]
|
||||
|
@ -305,8 +305,8 @@ class Telegram(RPC):
|
||||
)
|
||||
stats_tab = tabulate(
|
||||
[[day['date'],
|
||||
f"{day['abs_profit']} {stats['stake_currency']}",
|
||||
f"{day['fiat_value']} {stats['fiat_display_currency']}",
|
||||
f"{day['abs_profit']:.8f} {stats['stake_currency']}",
|
||||
f"{day['fiat_value']:.3f} {stats['fiat_display_currency']}",
|
||||
f"{day['trade_count']} trades"] for day in stats['data']],
|
||||
headers=[
|
||||
'Day',
|
||||
|
Loading…
Reference in New Issue
Block a user