Merge remote-tracking branch 'origin/additionalColumnForStatusTable' into wohlgemuth

This commit is contained in:
Gert Wohlgemuth 2018-05-11 15:35:44 -07:00
commit 4b31b79d37
2 changed files with 7 additions and 2 deletions

View File

@ -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

View File

@ -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,