add Kraken specifics

This commit is contained in:
Crypto God 2019-02-15 22:50:11 +01:00
parent 018cee8413
commit ef5a0b9afc
2 changed files with 93 additions and 12 deletions

View File

@ -0,0 +1,71 @@
{
"max_open_trades": 5,
"stake_currency": "EUR",
"stake_amount": 10,
"fiat_display_currency": "EUR",
"ticker_interval" : "5m",
"dry_run": true,
"db_url": "sqlite:///tradesv3.dryrun.sqlite",
"trailing_stop": false,
"unfilledtimeout": {
"buy": 10,
"sell": 30
},
"bid_strategy": {
"ask_last_balance": 0.0,
"use_order_book": false,
"order_book_top": 1,
"check_depth_of_market": {
"enabled": false,
"bids_to_ask_delta": 1
}
},
"ask_strategy":{
"use_order_book": false,
"order_book_min": 1,
"order_book_max": 9
},
"exchange": {
"name": "kraken",
"key": "",
"secret": "",
"ccxt_config": {"enableRateLimit": true},
"ccxt_async_config": {
"enableRateLimit": true,
"rateLimit": 3000
},
"pair_whitelist": [
"ETH/EUR",
"BTC/EUR",
"BCH/EUR"
],
"pair_blacklist": [
]
},
"edge": {
"enabled": false,
"process_throttle_secs": 3600,
"calculate_since_number_of_days": 7,
"capital_available_percentage": 0.5,
"allowed_risk": 0.01,
"stoploss_range_min": -0.01,
"stoploss_range_max": -0.1,
"stoploss_range_step": -0.01,
"minimum_winrate": 0.60,
"minimum_expectancy": 0.20,
"min_trade_number": 10,
"max_trade_duration_minute": 1440,
"remove_pumps": false
},
"telegram": {
"enabled": false,
"token": "",
"chat_id": ""
},
"initial_state": "running",
"forcebuy_enable": false,
"internals": {
"process_throttle_secs": 5
}
}

View File

@ -304,11 +304,14 @@ class Exchange(object):
amount = self.symbol_amount_prec(pair, amount) amount = self.symbol_amount_prec(pair, amount)
rate = self.symbol_price_prec(pair, rate) if ordertype != 'market' else None rate = self.symbol_price_prec(pair, rate) if ordertype != 'market' else None
if time_in_force == 'gtc': params = {}
return self._api.create_order(pair, ordertype, 'buy', amount, rate) if time_in_force != 'gtc':
else: params.update({'timeInForce': time_in_force})
return self._api.create_order(pair, ordertype, 'buy', if self.id == "kraken":
amount, rate, {'timeInForce': time_in_force}) params.update({"trading_agreement": "agree"})
return self._api.create_order(pair, ordertype, 'buy',
amount, rate, params)
except ccxt.InsufficientFunds as e: except ccxt.InsufficientFunds as e:
raise DependencyException( raise DependencyException(
@ -347,11 +350,14 @@ class Exchange(object):
amount = self.symbol_amount_prec(pair, amount) amount = self.symbol_amount_prec(pair, amount)
rate = self.symbol_price_prec(pair, rate) if ordertype != 'market' else None rate = self.symbol_price_prec(pair, rate) if ordertype != 'market' else None
if time_in_force == 'gtc': params = {}
return self._api.create_order(pair, ordertype, 'sell', amount, rate) if time_in_force != 'gtc':
else: params.update({'timeInForce': time_in_force})
return self._api.create_order(pair, ordertype, 'sell', if self.id == "kraken":
amount, rate, {'timeInForce': time_in_force}) params.update({"trading_agreement": "agree"})
return self._api.create_order(pair, ordertype, 'sell',
amount, rate, params)
except ccxt.InsufficientFunds as e: except ccxt.InsufficientFunds as e:
raise DependencyException( raise DependencyException(
@ -403,8 +409,12 @@ class Exchange(object):
return self._dry_run_open_orders[order_id] return self._dry_run_open_orders[order_id]
try: try:
params = {'stopPrice': stop_price}
if self.id == "kraken":
params.update({"trading_agreement": "agree"})
order = self._api.create_order(pair, 'stop_loss_limit', 'sell', order = self._api.create_order(pair, 'stop_loss_limit', 'sell',
amount, rate, {'stopPrice': stop_price}) amount, rate, params)
logger.info('stoploss limit order added for %s. ' logger.info('stoploss limit order added for %s. '
'stop price: %s. limit: %s' % (pair, stop_price, rate)) 'stop price: %s. limit: %s' % (pair, stop_price, rate))
return order return order
@ -546,7 +556,7 @@ class Exchange(object):
interval_in_sec = constants.TICKER_INTERVAL_MINUTES[ticker_interval] * 60 interval_in_sec = constants.TICKER_INTERVAL_MINUTES[ticker_interval] * 60
if not ((self._pairs_last_refresh_time.get((pair, ticker_interval), 0) if not ((self._pairs_last_refresh_time.get((pair, ticker_interval), 0)
+ interval_in_sec) >= arrow.utcnow().timestamp + interval_in_sec) >= arrow.utcnow().timestamp
and (pair, ticker_interval) in self._klines): and (pair, ticker_interval) in self._klines):
input_coroutines.append(self._async_get_candle_history(pair, ticker_interval)) input_coroutines.append(self._async_get_candle_history(pair, ticker_interval))
else: else: