initial SL and SL added to RPC

This commit is contained in:
Misagh 2019-03-27 22:00:46 +01:00
parent 0ca3a38ba6
commit 941921dd0f
2 changed files with 6 additions and 0 deletions

View File

@ -110,6 +110,8 @@ class RPC(object):
amount=round(trade.amount, 8), amount=round(trade.amount, 8),
close_profit=fmt_close_profit, close_profit=fmt_close_profit,
current_profit=round(current_profit * 100, 2), current_profit=round(current_profit * 100, 2),
initial_stoploss=trade.initial_stop_loss,
stoploss=trade.stop_loss,
open_order='({} {} rem={:.8f})'.format( open_order='({} {} rem={:.8f})'.format(
order['type'], order['side'], order['remaining'] order['type'], order['side'], order['remaining']
) if order else None, ) if order else None,

View File

@ -58,6 +58,8 @@ def test_rpc_trade_status(default_conf, ticker, fee, markets, mocker) -> None:
'amount': 90.99181074, 'amount': 90.99181074,
'close_profit': None, 'close_profit': None,
'current_profit': -0.59, 'current_profit': -0.59,
'initial_stoploss': 0.0,
'stoploss': 0.0,
'open_order': '(limit buy rem=0.00000000)' 'open_order': '(limit buy rem=0.00000000)'
} == results[0] } == results[0]
@ -78,6 +80,8 @@ def test_rpc_trade_status(default_conf, ticker, fee, markets, mocker) -> None:
'amount': 90.99181074, 'amount': 90.99181074,
'close_profit': None, 'close_profit': None,
'current_profit': ANY, 'current_profit': ANY,
'initial_stoploss': 0.0,
'stoploss': 0.0,
'open_order': '(limit buy rem=0.00000000)' 'open_order': '(limit buy rem=0.00000000)'
} == results[0] } == results[0]