From 3e3cce45596209f023459c03dadceea9697ec23e Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 26 May 2020 19:25:03 +0200 Subject: [PATCH] Use pct instead of _perc --- freqtrade/rpc/rpc.py | 4 ++-- freqtrade/rpc/telegram.py | 4 ++-- tests/rpc/test_rpc.py | 8 ++++---- tests/rpc/test_rpc_apiserver.py | 4 ++-- tests/rpc/test_rpc_telegram.py | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/freqtrade/rpc/rpc.py b/freqtrade/rpc/rpc.py index cf222a238..69f38e524 100644 --- a/freqtrade/rpc/rpc.py +++ b/freqtrade/rpc/rpc.py @@ -136,10 +136,10 @@ class RPC: trade_dict.update(dict( base_currency=self._freqtrade.config['stake_currency'], close_profit=trade.close_profit or None, - close_profit_perc=fmt_close_profit, + close_profit_pct=fmt_close_profit, current_rate=current_rate, current_profit=current_profit, - current_profit_perc=round(current_profit * 100, 2), + current_profit_pct=round(current_profit * 100, 2), open_order='({} {} rem={:.8f})'.format( order['type'], order['side'], order['remaining'] ) if order else None, diff --git a/freqtrade/rpc/telegram.py b/freqtrade/rpc/telegram.py index 37c1077a7..77c72bb2a 100644 --- a/freqtrade/rpc/telegram.py +++ b/freqtrade/rpc/telegram.py @@ -215,8 +215,8 @@ 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_perc}`" if r['close_profit_perc'] else "", - "*Current Profit:* `{current_profit_perc:.2f}%`", + "*Close Profit:* `{close_profit_pct}`" if r['close_profit_pct'] else "", + "*Current Profit:* `{current_profit_pct:.2f}%`", # Adding initial stoploss only if it is different from stoploss "*Initial Stoploss:* `{initial_stop_loss:.8f}` " + diff --git a/tests/rpc/test_rpc.py b/tests/rpc/test_rpc.py index 5d278895b..e94097545 100644 --- a/tests/rpc/test_rpc.py +++ b/tests/rpc/test_rpc.py @@ -76,9 +76,9 @@ def test_rpc_trade_status(default_conf, ticker, fee, mocker) -> None: 'amount': 91.07468124, 'stake_amount': 0.001, 'close_profit': None, - 'close_profit_perc': None, + 'close_profit_pct': None, 'current_profit': -0.00408133, - 'current_profit_perc': -0.41, + 'current_profit_pct': -0.41, 'stop_loss': 0.0, 'initial_stop_loss': 0.0, 'initial_stop_loss_pct': None, @@ -124,9 +124,9 @@ def test_rpc_trade_status(default_conf, ticker, fee, mocker) -> None: 'amount': 91.07468124, 'stake_amount': 0.001, 'close_profit': None, - 'close_profit_perc': None, + 'close_profit_pct': None, 'current_profit': ANY, - 'current_profit_perc': ANY, + 'current_profit_pct': ANY, 'stop_loss': 0.0, 'initial_stop_loss': 0.0, 'initial_stop_loss_pct': None, diff --git a/tests/rpc/test_rpc_apiserver.py b/tests/rpc/test_rpc_apiserver.py index 1c0df9903..cc63bf6e8 100644 --- a/tests/rpc/test_rpc_apiserver.py +++ b/tests/rpc/test_rpc_apiserver.py @@ -501,10 +501,10 @@ def test_api_status(botclient, mocker, ticker, fee, markets): 'close_date_hum': None, 'close_timestamp': None, 'close_profit': None, - 'close_profit_perc': None, + 'close_profit_pct': None, 'close_rate': None, 'current_profit': -0.00408133, - 'current_profit_perc': -0.41, + 'current_profit_pct': -0.41, 'current_rate': 1.099e-05, 'initial_stop_loss': 0.0, 'initial_stop_loss_pct': None, diff --git a/tests/rpc/test_rpc_telegram.py b/tests/rpc/test_rpc_telegram.py index 1d599d13e..730bb2677 100644 --- a/tests/rpc/test_rpc_telegram.py +++ b/tests/rpc/test_rpc_telegram.py @@ -166,9 +166,9 @@ def test_status(default_conf, update, mocker, fee, ticker,) -> None: 'current_rate': 1.098e-05, 'amount': 90.99181074, 'stake_amount': 90.99181074, - 'close_profit_perc': None, + 'close_profit_pct': None, 'current_profit': -0.0059, - 'current_profit_perc': -0.59, + 'current_profit_pct': -0.59, 'initial_stop_loss': 1.098e-05, 'stop_loss': 1.099e-05, 'sell_order_status': None,