1313logger = logging .getLogger ("investing_algorithm_framework" )
1414
1515
16-
1716class CCXTDataProvider (DataProvider ):
1817 """
1918 """
@@ -29,7 +28,7 @@ def __init__(
2928 symbol = None ,
3029 time_frame = None ,
3130 window_size = None ,
32- priority = 1
31+ priority = 1
3332 ):
3433 super ().__init__ (
3534 data_type = data_type ,
@@ -134,12 +133,13 @@ def has_data(
134133 symbols = list (symbols .keys ())
135134 return symbol in symbols
136135
137- except ccxt .NetworkError as e :
136+ except ccxt .NetworkError :
138137 raise NetworkError (
139138 "Network error occurred, make sure you have "
140139 "an active internet connection"
141140 )
142- except Exception as e :
141+
142+ except Exception :
143143 return False
144144
145145 def get_data (
@@ -161,15 +161,17 @@ def get_data(
161161
162162 if market is None :
163163 raise OperationalException (
164- "Market is not set. Please set the market before calling get_data."
164+ "Market is not set. Please set the market "
165+ "before calling get_data."
165166 )
166167
167168 if symbol is None :
168169 symbol = self .symbol
169170
170171 if symbol is None :
171172 raise OperationalException (
172- "Symbol is not set. Please set the symbol before calling get_data."
173+ "Symbol is not set. Please set the symbol "
174+ "before calling get_data."
173175 )
174176
175177 if data_type is None :
@@ -195,7 +197,6 @@ def get_data(
195197 if end_date is None :
196198 end_date = datetime .now (tz = timezone .utc )
197199
198-
199200 if start_date is None :
200201
201202 if date is not None :
@@ -309,4 +310,4 @@ def get_ohlcv(
309310
310311 def create_start_date (self , end_date , time_frame , window_size ):
311312 minutes = TimeFrame .from_value (time_frame ).amount_of_minutes
312- return end_date - timedelta (minutes = window_size * minutes )
313+ return end_date - timedelta (minutes = window_size * minutes )
0 commit comments