added real tests for stop on exchange in dry-run

This commit is contained in:
misagh
2018-11-24 18:26:04 +01:00
parent 000711b025
commit b2c0b20a58
2 changed files with 23 additions and 17 deletions

View File

@@ -349,6 +349,23 @@ class Exchange(object):
raise OperationalException(
'In stoploss limit order, stop price should be more than limit price')
if self._conf['dry_run']:
order_id = f'dry_run_buy_{randint(0, 10**6)}'
self._dry_run_open_orders[order_id] = {
'info': {},
'id': order_id,
'pair': pair,
'price': stop_price,
'amount': amount,
'type': 'stop_loss_limit',
'side': 'sell',
'remaining': amount,
'datetime': arrow.utcnow().isoformat(),
'status': 'open',
'fee': None
}
return self._dry_run_open_orders[order_id]
return self._api.create_order(pair, 'stop_loss', 'sell',
amount, rate, {'stopPrice': stop_price})