Align mixtag response with other statistic models
This commit is contained in:
@@ -1790,7 +1790,7 @@ class Trade(ModelBase, LocalTrade):
|
|||||||
i = 0
|
i = 0
|
||||||
if not any(item["mix_tag"] == mix_tag for item in return_list):
|
if not any(item["mix_tag"] == mix_tag for item in return_list):
|
||||||
return_list.append({'mix_tag': mix_tag,
|
return_list.append({'mix_tag': mix_tag,
|
||||||
'profit': profit,
|
'profit_ratio': profit,
|
||||||
'profit_pct': round(profit * 100, 2),
|
'profit_pct': round(profit * 100, 2),
|
||||||
'profit_abs': profit_abs,
|
'profit_abs': profit_abs,
|
||||||
'count': count})
|
'count': count})
|
||||||
@@ -1799,7 +1799,7 @@ class Trade(ModelBase, LocalTrade):
|
|||||||
if return_list[i]["mix_tag"] == mix_tag:
|
if return_list[i]["mix_tag"] == mix_tag:
|
||||||
return_list[i] = {
|
return_list[i] = {
|
||||||
'mix_tag': mix_tag,
|
'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_pct': round(profit + return_list[i]["profit"] * 100, 2),
|
||||||
'profit_abs': profit_abs + return_list[i]["profit_abs"],
|
'profit_abs': profit_abs + return_list[i]["profit_abs"],
|
||||||
'count': 1 + return_list[i]["count"]}
|
'count': 1 + return_list[i]["count"]}
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ class Exit(BaseModel):
|
|||||||
|
|
||||||
class MixTag(BaseModel):
|
class MixTag(BaseModel):
|
||||||
mix_tag: str
|
mix_tag: str
|
||||||
profit: float
|
profit_ratio: float
|
||||||
profit_pct: float
|
profit_pct: float
|
||||||
profit_abs: float
|
profit_abs: float
|
||||||
count: int
|
count: int
|
||||||
|
|||||||
@@ -1378,7 +1378,7 @@ class Telegram(RPCHandler):
|
|||||||
stat_line = (
|
stat_line = (
|
||||||
f"{i+1}.\t <code>{trade['mix_tag']}\t"
|
f"{i+1}.\t <code>{trade['mix_tag']}\t"
|
||||||
f"{round_coin_value(trade['profit_abs'], self._config['stake_currency'])} "
|
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")
|
f"({trade['count']})</code>\n")
|
||||||
|
|
||||||
if len(output + stat_line) >= MAX_MESSAGE_LENGTH:
|
if len(output + stat_line) >= MAX_MESSAGE_LENGTH:
|
||||||
|
|||||||
Reference in New Issue
Block a user