undo kraken specific changes

This commit is contained in:
iuvbio 2019-02-17 03:59:40 +01:00
parent 8ed3658447
commit 54d5bce445
1 changed files with 9 additions and 18 deletions

View File

@ -304,14 +304,11 @@ class Exchange(object):
amount = self.symbol_amount_prec(pair, amount)
rate = self.symbol_price_prec(pair, rate) if ordertype != 'market' else None
params = {}
if time_in_force != 'gtc':
params.update({'timeInForce': time_in_force})
if self.id == "kraken":
params.update({"trading_agreement": "agree"})
return self._api.create_order(pair, ordertype, 'buy',
amount, rate, params)
return self._api.create_order(pair, ordertype, 'buy', amount, rate)
else:
return self._api.create_order(pair, ordertype, 'buy',
amount, rate, {'timeInForce': time_in_force})
except ccxt.InsufficientFunds as e:
raise DependencyException(
@ -350,14 +347,11 @@ class Exchange(object):
amount = self.symbol_amount_prec(pair, amount)
rate = self.symbol_price_prec(pair, rate) if ordertype != 'market' else None
params = {}
if time_in_force != 'gtc':
params.update({'timeInForce': time_in_force})
if self.id == "kraken":
params.update({"trading_agreement": "agree"})
return self._api.create_order(pair, ordertype, 'sell',
amount, rate, params)
return self._api.create_order(pair, ordertype, 'sell', amount, rate)
else:
return self._api.create_order(pair, ordertype, 'sell',
amount, rate, {'timeInForce': time_in_force})
except ccxt.InsufficientFunds as e:
raise DependencyException(
@ -409,12 +403,9 @@ class Exchange(object):
return self._dry_run_open_orders[order_id]
try:
params = {'stopPrice': stop_price}
if self.id == "kraken":
params.update({"trading_agreement": "agree"})
order = self._api.create_order(pair, 'stop_loss_limit', 'sell',
amount, rate, params)
amount, rate, {'stopPrice': stop_price})
logger.info('stoploss limit order added for %s. '
'stop price: %s. limit: %s' % (pair, stop_price, rate))
return order