add markets property

This commit is contained in:
iuvbio 2019-03-04 23:59:08 +01:00
parent d423f58566
commit 3a2aa54d2a
1 changed files with 6 additions and 1 deletions

View File

@ -106,7 +106,7 @@ class Exchange(object):
logger.info('Using Exchange "%s"', self.name)
self.markets = self._load_markets()
self._load_markets()
# Check if all pairs are available
self.validate_pairs(config['exchange']['pair_whitelist'])
self.validate_ordertypes(config.get('order_types', {}))
@ -165,6 +165,11 @@ class Exchange(object):
"""exchange ccxt id"""
return self._api.id
@property
def markets(self) -> Dict:
"""exchange ccxt markets"""
return self._api.markets
def klines(self, pair_interval: Tuple[str, str], copy=True) -> DataFrame:
if pair_interval in self._klines:
return self._klines[pair_interval].copy() if copy else self._klines[pair_interval]