Align mixtag response with other statistic models

This commit is contained in:
Matthias 2023-11-11 16:57:42 +01:00
parent da647735b6
commit 7daa06a207
3 changed files with 4 additions and 4 deletions

View File

@ -1790,7 +1790,7 @@ class Trade(ModelBase, LocalTrade):
i = 0
if not any(item["mix_tag"] == mix_tag for item in return_list):
return_list.append({'mix_tag': mix_tag,
'profit': profit,
'profit_ratio': profit,
'profit_pct': round(profit * 100, 2),
'profit_abs': profit_abs,
'count': count})
@ -1799,7 +1799,7 @@ class Trade(ModelBase, LocalTrade):
if return_list[i]["mix_tag"] == mix_tag:
return_list[i] = {
'mix_tag': mix_tag,
'profit': profit + return_list[i]["profit"],
'profit_ratio': profit + return_list[i]["profit"],
'profit_pct': round(profit + return_list[i]["profit"] * 100, 2),
'profit_abs': profit_abs + return_list[i]["profit_abs"],
'count': 1 + return_list[i]["count"]}

View File

@ -113,7 +113,7 @@ class Exit(BaseModel):
class MixTag(BaseModel):
mix_tag: str
profit: float
profit_ratio: float
profit_pct: float
profit_abs: float
count: int

View File

@ -1378,7 +1378,7 @@ class Telegram(RPCHandler):
stat_line = (
f"{i+1}.\t <code>{trade['mix_tag']}\t"
f"{round_coin_value(trade['profit_abs'], self._config['stake_currency'])} "
f"({trade['profit']:.2%}) "
f"({trade['profit_ratio']:.2%}) "
f"({trade['count']})</code>\n")
if len(output + stat_line) >= MAX_MESSAGE_LENGTH: