check if markets were loaded

This commit is contained in:
iuvbio 2019-03-06 22:57:31 +01:00
parent 041e9957dd
commit df9410cd15
1 changed files with 3 additions and 0 deletions

View File

@ -168,6 +168,9 @@ class Exchange(object):
@property
def markets(self) -> Dict:
"""exchange ccxt markets"""
if not self._api.markets:
logger.warning("Markets were not loaded. Loading them now..")
self._load_markets()
return self._api.markets
def klines(self, pair_interval: Tuple[str, str], copy=True) -> DataFrame: