From 3e27232e9b821030c1c8087892e98f993c45a4de Mon Sep 17 00:00:00 2001 From: Gert Wohlgemuth Date: Tue, 1 May 2018 21:34:16 -0700 Subject: [PATCH 1/7] added additional column for the status table to see current stake currency value --- freqtrade/rpc/rpc.py | 5 +++-- freqtrade/tests/rpc/test_rpc.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/freqtrade/rpc/rpc.py b/freqtrade/rpc/rpc.py index 860d3ba43..5ad7b6b03 100644 --- a/freqtrade/rpc/rpc.py +++ b/freqtrade/rpc/rpc.py @@ -98,10 +98,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)), + '{:.6f}'.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 84b06bee2..01840dfd3 100644 --- a/freqtrade/tests/rpc/test_rpc.py +++ b/freqtrade/tests/rpc/test_rpc.py @@ -104,7 +104,7 @@ def test_rpc_status_table(default_conf, ticker, mocker) -> None: assert 'just now' in result['Since'].all() assert 'BTC_ETH' in result['Pair'].all() assert '-0.59%' in result['Profit'].all() - + assert 'Value' in result def test_rpc_daily_profit(default_conf, update, ticker, limit_buy_order, limit_sell_order, mocker)\ -> None: From fd3dcea2b4adfaac3f1cb5872b42d7a6590162d1 Mon Sep 17 00:00:00 2001 From: Gert Wohlgemuth Date: Tue, 1 May 2018 22:18:29 -0700 Subject: [PATCH 2/7] fixed styling error --- freqtrade/tests/rpc/test_rpc.py | 1 + 1 file changed, 1 insertion(+) diff --git a/freqtrade/tests/rpc/test_rpc.py b/freqtrade/tests/rpc/test_rpc.py index 01840dfd3..ef28fc859 100644 --- a/freqtrade/tests/rpc/test_rpc.py +++ b/freqtrade/tests/rpc/test_rpc.py @@ -106,6 +106,7 @@ def test_rpc_status_table(default_conf, ticker, mocker) -> None: assert '-0.59%' in result['Profit'].all() assert 'Value' in result + def test_rpc_daily_profit(default_conf, update, ticker, limit_buy_order, limit_sell_order, mocker)\ -> None: """ From 3e21818ee0269739a4614a9e40e76e5e9aee2ef7 Mon Sep 17 00:00:00 2001 From: Gert Wohlgemuth Date: Wed, 2 May 2018 22:45:47 -0700 Subject: [PATCH 3/7] added stake value to status as well --- freqtrade/rpc/rpc.py | 2 ++ freqtrade/tests/rpc/test_rpc.py | 1 + 2 files changed, 3 insertions(+) diff --git a/freqtrade/rpc/rpc.py b/freqtrade/rpc/rpc.py index 5ad7b6b03..59c9e587d 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,6), current_profit=round(current_profit * 100, 2), open_order='({} rem={:.8f})'.format( order['type'], order['remaining'] diff --git a/freqtrade/tests/rpc/test_rpc.py b/freqtrade/tests/rpc/test_rpc.py index ef28fc859..40746b9b1 100644 --- a/freqtrade/tests/rpc/test_rpc.py +++ b/freqtrade/tests/rpc/test_rpc.py @@ -66,6 +66,7 @@ def test_rpc_trade_status(default_conf, ticker, mocker) -> None: '*Close Rate:* `None`\n' '*Current Rate:* `0.00001098`\n' '*Close Profit:* `None`\n' + '*Stake Value:* `0.000999`\n' '*Current Profit:* `-0.59%`\n' '*Open Order:* `(LIMIT_BUY rem=0.00000000)`' ] From cd2ecf7a0be91ab9cc610f550fbf83ec1d1da12d Mon Sep 17 00:00:00 2001 From: Gert Wohlgemuth Date: Wed, 2 May 2018 22:55:49 -0700 Subject: [PATCH 4/7] fixed trailing whitespace issue --- freqtrade/tests/rpc/test_rpc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freqtrade/tests/rpc/test_rpc.py b/freqtrade/tests/rpc/test_rpc.py index 40746b9b1..35c4d6d77 100644 --- a/freqtrade/tests/rpc/test_rpc.py +++ b/freqtrade/tests/rpc/test_rpc.py @@ -66,7 +66,7 @@ def test_rpc_trade_status(default_conf, ticker, mocker) -> None: '*Close Rate:* `None`\n' '*Current Rate:* `0.00001098`\n' '*Close Profit:* `None`\n' - '*Stake Value:* `0.000999`\n' + '*Stake Value:* `0.000999`\n' '*Current Profit:* `-0.59%`\n' '*Open Order:* `(LIMIT_BUY rem=0.00000000)`' ] From 4bd088ee3a62cd05eb96ae20662fd672dff7b005 Mon Sep 17 00:00:00 2001 From: Gert Wohlgemuth Date: Sun, 6 May 2018 12:32:46 -0700 Subject: [PATCH 5/7] Update rpc.py --- freqtrade/rpc/rpc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/freqtrade/rpc/rpc.py b/freqtrade/rpc/rpc.py index 59c9e587d..9add95769 100644 --- a/freqtrade/rpc/rpc.py +++ b/freqtrade/rpc/rpc.py @@ -76,7 +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,6), + stake_value=round(current_rate * trade.amount, 8), current_profit=round(current_profit * 100, 2), open_order='({} rem={:.8f})'.format( order['type'], order['remaining'] @@ -101,7 +101,7 @@ class RPC(object): trade.pair, shorten_date(arrow.get(trade.open_date).humanize(only_distance=True)), '{:.2f}%'.format(100 * trade.calc_profit_percent(current_rate)), - '{:.6f}'.format(trade.amount * current_rate) + '{:.8f}'.format(trade.amount * current_rate) ]) columns = ['ID', 'Pair', 'Since', 'Profit', 'Value'] From 24b3a51546dfeaa2574d649beec9119712185727 Mon Sep 17 00:00:00 2001 From: Gert Wohlgemuth Date: Sun, 6 May 2018 12:33:12 -0700 Subject: [PATCH 6/7] Update test_rpc.py --- freqtrade/tests/rpc/test_rpc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freqtrade/tests/rpc/test_rpc.py b/freqtrade/tests/rpc/test_rpc.py index 35c4d6d77..4c2e1f3f7 100644 --- a/freqtrade/tests/rpc/test_rpc.py +++ b/freqtrade/tests/rpc/test_rpc.py @@ -66,7 +66,7 @@ def test_rpc_trade_status(default_conf, ticker, mocker) -> None: '*Close Rate:* `None`\n' '*Current Rate:* `0.00001098`\n' '*Close Profit:* `None`\n' - '*Stake Value:* `0.000999`\n' + '*Stake Value:* `0.00099999`\n' '*Current Profit:* `-0.59%`\n' '*Open Order:* `(LIMIT_BUY rem=0.00000000)`' ] From de056ec4254af1593e4347844f227f15d3937343 Mon Sep 17 00:00:00 2001 From: Gert Wohlgemuth Date: Tue, 8 May 2018 22:42:21 -0700 Subject: [PATCH 7/7] Update test_rpc.py --- freqtrade/tests/rpc/test_rpc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freqtrade/tests/rpc/test_rpc.py b/freqtrade/tests/rpc/test_rpc.py index 4c2e1f3f7..def83721a 100644 --- a/freqtrade/tests/rpc/test_rpc.py +++ b/freqtrade/tests/rpc/test_rpc.py @@ -66,7 +66,7 @@ def test_rpc_trade_status(default_conf, ticker, mocker) -> None: '*Close Rate:* `None`\n' '*Current Rate:* `0.00001098`\n' '*Close Profit:* `None`\n' - '*Stake Value:* `0.00099999`\n' + '*Stake Value:* `0.00099909`\n' '*Current Profit:* `-0.59%`\n' '*Open Order:* `(LIMIT_BUY rem=0.00000000)`' ]