added support to show current btc value in status table
This commit is contained in:
parent
f324c7b0d0
commit
c8ee1bc966
@ -98,10 +98,11 @@ class RPC(object):
|
|||||||
trade.id,
|
trade.id,
|
||||||
trade.pair,
|
trade.pair,
|
||||||
shorten_date(arrow.get(trade.open_date).humanize(only_distance=True)),
|
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 = DataFrame.from_records(trades_list, columns=columns)
|
||||||
df_statuses = df_statuses.set_index(columns[0])
|
df_statuses = df_statuses.set_index(columns[0])
|
||||||
# The style used throughout is to return a tuple
|
# The style used throughout is to return a tuple
|
||||||
|
@ -99,12 +99,13 @@ def test_rpc_status_table(default_conf, ticker, mocker) -> None:
|
|||||||
assert error
|
assert error
|
||||||
assert '*Status:* `no active order`' in result
|
assert '*Status:* `no active order`' in result
|
||||||
|
|
||||||
|
print(result)
|
||||||
freqtradebot.create_trade()
|
freqtradebot.create_trade()
|
||||||
(error, result) = rpc.rpc_status_table()
|
(error, result) = rpc.rpc_status_table()
|
||||||
assert 'just now' in result['Since'].all()
|
assert 'just now' in result['Since'].all()
|
||||||
assert 'BTC_ETH' in result['Pair'].all()
|
assert 'BTC_ETH' in result['Pair'].all()
|
||||||
assert '-0.59%' in result['Profit'].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)\
|
def test_rpc_daily_profit(default_conf, update, ticker, limit_buy_order, limit_sell_order, mocker)\
|
||||||
-> None:
|
-> None:
|
||||||
|
Loading…
Reference in New Issue
Block a user