diff --git a/freqtrade/rpc/rpc.py b/freqtrade/rpc/rpc.py index 05bdafd08..0929a0df7 100644 --- a/freqtrade/rpc/rpc.py +++ b/freqtrade/rpc/rpc.py @@ -63,6 +63,7 @@ class RPC(object): "*Close Rate:* `{close_rate}`\n" \ "*Current Rate:* `{current_rate:.8f}`\n" \ "*Close Profit:* `{close_profit}`\n" \ + "*Stake Value:* `{stake_value}`\n" \ "*Current Profit:* `{current_profit:.2f}%`\n" \ "*Open Order:* `{open_order}`"\ .format( @@ -75,6 +76,7 @@ class RPC(object): current_rate=current_rate, amount=round(trade.amount, 8), close_profit=fmt_close_profit, + stake_value=round(current_rate * trade.amount, 8), current_profit=round(current_profit * 100, 2), open_order='({} {} rem={:.8f})'.format( order['type'], order['side'], order['remaining'] @@ -98,10 +100,11 @@ class RPC(object): trade.id, trade.pair, shorten_date(arrow.get(trade.open_date).humanize(only_distance=True)), - '{:.2f}%'.format(100 * trade.calc_profit_percent(current_rate)) + '{:.2f}%'.format(100 * trade.calc_profit_percent(current_rate)), + '{:.8f}'.format(trade.amount * current_rate) ]) - columns = ['ID', 'Pair', 'Since', 'Profit'] + columns = ['ID', 'Pair', 'Since', 'Profit', 'Value'] df_statuses = DataFrame.from_records(trades_list, columns=columns) df_statuses = df_statuses.set_index(columns[0]) # The style used throughout is to return a tuple diff --git a/freqtrade/tests/rpc/test_rpc.py b/freqtrade/tests/rpc/test_rpc.py index f600af5dc..034e40291 100644 --- a/freqtrade/tests/rpc/test_rpc.py +++ b/freqtrade/tests/rpc/test_rpc.py @@ -67,6 +67,7 @@ def test_rpc_trade_status(default_conf, ticker, fee, mocker) -> None: '*Close Rate:* `None`\n' '*Current Rate:* `0.00001098`\n' '*Close Profit:* `None`\n' + '*Stake Value:* `0.00099909`\n' '*Current Profit:* `-0.59%`\n' '*Open Order:* `(limit buy rem=0.00000000)`' ] @@ -106,6 +107,7 @@ def test_rpc_status_table(default_conf, ticker, fee, mocker) -> None: assert 'just now' in result['Since'].all() assert 'ETH/BTC' in result['Pair'].all() assert '-0.59%' in result['Profit'].all() + assert 'Value' in result def test_rpc_daily_profit(default_conf, update, ticker, fee,