mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
load generic class if no subclass exists
This commit is contained in:
parent
d3ead2cd09
commit
fe792882b5
|
@ -17,6 +17,7 @@ from freqtrade import (DependencyException, OperationalException,
|
|||
from freqtrade.data.converter import order_book_to_dataframe
|
||||
from freqtrade.data.dataprovider import DataProvider
|
||||
from freqtrade.edge import Edge
|
||||
from freqtrade.exchange import Exchange
|
||||
from freqtrade.persistence import Trade
|
||||
from freqtrade.rpc import RPCManager, RPCMessageType
|
||||
from freqtrade.resolvers import ExchangeResolver, StrategyResolver, PairListResolver
|
||||
|
@ -55,8 +56,12 @@ class FreqtradeBot(object):
|
|||
|
||||
self.rpc: RPCManager = RPCManager(self)
|
||||
|
||||
exchange_name = self.config.get('exchange', {}).get('name', 'binance')
|
||||
self.exchange = ExchangeResolver(exchange_name, self, self.config)
|
||||
exchange_name = self.config.get('exchange', {}).get('name', 'bittrex')
|
||||
try:
|
||||
self.exchange = ExchangeResolver(exchange_name, self, self.config).exchange
|
||||
except ImportError:
|
||||
logger.info(f"No {exchange_name} specific subclass found. Using the generic class instead.")
|
||||
self.exchange = Exchange(self.config)
|
||||
|
||||
self.wallets = Wallets(self.exchange)
|
||||
self.dataprovider = DataProvider(self.config, self.exchange)
|
||||
|
|
|
@ -22,7 +22,7 @@ class ExchangeResolver(IResolver):
|
|||
Load the custom class from config parameter
|
||||
:param config: configuration dictionary or None
|
||||
"""
|
||||
self.pairlist = self._load_exchange(exchange_name, kwargs={'freqtrade': freqtrade,
|
||||
self.exchange = self._load_exchange(exchange_name, kwargs={'freqtrade': freqtrade,
|
||||
'config': config})
|
||||
|
||||
def _load_exchange(
|
||||
|
|
Loading…
Reference in New Issue
Block a user