mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Use correct fields in telegram
This commit is contained in:
parent
d1dab23283
commit
b58d6d38b5
|
@ -247,14 +247,13 @@ class Telegram(RPC):
|
|||
"*Open Rate:* `{open_rate:.8f}`",
|
||||
"*Close Rate:* `{close_rate}`" if r['close_rate'] else "",
|
||||
"*Current Rate:* `{current_rate:.8f}`",
|
||||
("*Close Profit:* `{close_profit_pct}`"
|
||||
if r['close_profit_pct'] is not None else ""),
|
||||
"*Current Profit:* `{current_profit_pct:.2f}%`",
|
||||
("*Current Profit:* " if r['is_open'] else "*Close Profit: *")
|
||||
+ "`{profit_pct:.2f}%`",
|
||||
]
|
||||
if (r['stop_loss_abs'] != r['initial_stop_loss_abs']
|
||||
and r['initial_stop_loss_pct'] is not None):
|
||||
# Adding initial stoploss only if it is different from stoploss
|
||||
lines.append("*Initial Stoploss:* `{initial_stop_loss:.8f}` "
|
||||
lines.append("*Initial Stoploss:* `{initial_stop_loss_abs:.8f}` "
|
||||
"`({initial_stop_loss_pct:.2f}%)`")
|
||||
|
||||
# Adding stoploss and stoploss percentage only if it is not None
|
||||
|
|
|
@ -163,16 +163,17 @@ def test_telegram_status(default_conf, update, mocker) -> None:
|
|||
'amount': 90.99181074,
|
||||
'stake_amount': 90.99181074,
|
||||
'close_profit_pct': None,
|
||||
'current_profit': -0.0059,
|
||||
'current_profit_pct': -0.59,
|
||||
'initial_stop_loss': 1.098e-05,
|
||||
'stop_loss': 1.099e-05,
|
||||
'profit': -0.0059,
|
||||
'profit_pct': -0.59,
|
||||
'initial_stop_loss_abs': 1.098e-05,
|
||||
'stop_loss_abs': 1.099e-05,
|
||||
'sell_order_status': None,
|
||||
'initial_stop_loss_pct': -0.05,
|
||||
'stoploss_current_dist': 1e-08,
|
||||
'stoploss_current_dist_pct': -0.02,
|
||||
'stop_loss_pct': -0.01,
|
||||
'open_order': '(limit buy rem=0.00000000)'
|
||||
'open_order': '(limit buy rem=0.00000000)',
|
||||
'is_open': True
|
||||
}]),
|
||||
_status_table=status_table,
|
||||
_send_msg=msg_mock
|
||||
|
|
Loading…
Reference in New Issue
Block a user