From 1678a039aee6cd06981152205b833bd0202ab512 Mon Sep 17 00:00:00 2001 From: Misagh Date: Wed, 27 Mar 2019 21:32:56 +0100 Subject: [PATCH] removing close profit is trade is open --- freqtrade/rpc/telegram.py | 2 +- freqtrade/tests/rpc/test_rpc_telegram.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/freqtrade/rpc/telegram.py b/freqtrade/rpc/telegram.py index 1e1436631..0870e660b 100644 --- a/freqtrade/rpc/telegram.py +++ b/freqtrade/rpc/telegram.py @@ -203,7 +203,7 @@ 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}`", + "*Close Profit:* `{close_profit}`" if r['close_profit'] else "", "*Current Profit:* `{current_profit:.2f}%`", "*Open Order:* `{open_order}`" ] diff --git a/freqtrade/tests/rpc/test_rpc_telegram.py b/freqtrade/tests/rpc/test_rpc_telegram.py index 39973d5db..d1a068100 100644 --- a/freqtrade/tests/rpc/test_rpc_telegram.py +++ b/freqtrade/tests/rpc/test_rpc_telegram.py @@ -272,6 +272,7 @@ def test_status_handle(default_conf, update, ticker, fee, markets, mocker) -> No lines = msg_mock.call_args_list[0][0][0].split('\n') assert '' not in lines assert 'Close Rate' not in ''.join(lines) + assert 'Close Profit' not in ''.join(lines) assert msg_mock.call_count == 1 assert 'ETH/BTC' in msg_mock.call_args_list[0][0][0]