X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=portfolio.py;h=9f82d881fcfac30e440b06d3e3c423167c994ce2;hb=e0b14bcc15b5ce397733c2a965917ce17dd935b3;hp=cb14c5d6223d44751f6f99d1f886e9a8aa5de7c2;hpb=e2c6184cdf2c4a9f9bc809088056cc365d243b13;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FCryptoportfolio%2FTrader.git diff --git a/portfolio.py b/portfolio.py index cb14c5d..9f82d88 100644 --- a/portfolio.py +++ b/portfolio.py @@ -1,4 +1,4 @@ -import ccxt +from ccxt import ExchangeError import time from decimal import Decimal as D # Put your poloniex api key in market.py @@ -304,11 +304,11 @@ class Trade: try: cls.ticker_cache[(c1, c2, market.__class__)] = market.fetch_ticker("{}/{}".format(c1, c2)) augment_ticker(cls.ticker_cache[(c1, c2, market.__class__)]) - except ccxt.ExchangeError: + except ExchangeError: try: cls.ticker_cache[(c2, c1, market.__class__)] = market.fetch_ticker("{}/{}".format(c2, c1)) augment_ticker(cls.ticker_cache[(c2, c1, market.__class__)]) - except ccxt.ExchangeError: + except ExchangeError: cls.ticker_cache[(c1, c2, market.__class__)] = None return cls.get_ticker(c1, c2, market)