Add Support for kraken stoploss-limit

This commit is contained in:
Matthias
2020-11-25 16:27:27 +01:00
parent 8180393bbc
commit c14c0f60a1
4 changed files with 36 additions and 21 deletions

View File

@@ -77,8 +77,15 @@ class Kraken(Exchange):
Creates a stoploss market order.
Stoploss market orders is the only stoploss type supported by kraken.
"""
params = self._params.copy()
ordertype = "stop-loss"
if order_types.get('stoploss', 'market') == 'limit':
ordertype = "stop-loss-limit"
limit_price_pct = order_types.get('stoploss_on_exchange_limit_ratio', 0.99)
limit_rate = stop_price * limit_price_pct
params['price2'] = self.price_to_precision(pair, limit_rate)
else:
ordertype = "stop-loss"
stop_price = self.price_to_precision(pair, stop_price)
@@ -88,8 +95,6 @@ class Kraken(Exchange):
return dry_order
try:
params = self._params.copy()
amount = self.amount_to_precision(pair, amount)
order = self._api.create_order(symbol=pair, type=ordertype, side='sell',