From 65d1598a90f4a395f3b1929d3e8887875bdff5ef Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 27 Feb 2023 20:50:25 +0100 Subject: [PATCH] Show absolute profit in /status command --- freqtrade/rpc/telegram.py | 3 ++- tests/rpc/test_rpc_telegram.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/freqtrade/rpc/telegram.py b/freqtrade/rpc/telegram.py index cb7d4515f..34b54e047 100644 --- a/freqtrade/rpc/telegram.py +++ b/freqtrade/rpc/telegram.py @@ -561,6 +561,7 @@ class Telegram(RPCHandler): r['num_entries'] = len([o for o in r['orders'] if o['ft_is_entry']]) r['exit_reason'] = r.get('exit_reason', "") r['rounded_stake_amount'] = round_coin_value(r['stake_amount'], r['quote_currency']) + r['rounded_profit_abs'] = round_coin_value(r['profit_abs'], r['quote_currency']) lines = [ "*Trade ID:* `{trade_id}`" + (" `(since {open_date_hum})`" if r['is_open'] else ""), @@ -583,7 +584,7 @@ class Telegram(RPCHandler): "*Close Date:* `{close_date}`" if r['close_date'] else "", "*Current Rate:* `{current_rate:.8f}`" if r['is_open'] else "", ("*Current Profit:* " if r['is_open'] else "*Close Profit: *") - + "`{profit_ratio:.2%}`", + + "`{profit_ratio:.2%}` `({rounded_profit_abs})`", ]) if r['is_open']: diff --git a/tests/rpc/test_rpc_telegram.py b/tests/rpc/test_rpc_telegram.py index 855062af0..974cc45f7 100644 --- a/tests/rpc/test_rpc_telegram.py +++ b/tests/rpc/test_rpc_telegram.py @@ -202,6 +202,7 @@ def test_telegram_status(default_conf, update, mocker) -> None: 'close_profit_ratio': None, 'profit': -0.0059, 'profit_ratio': -0.0059, + 'profit_abs': -0.225, 'initial_stop_loss_abs': 1.098e-05, 'stop_loss_abs': 1.099e-05, 'exit_order_status': None,