@@ -47,9 +47,6 @@ class PriceData:
4747 def __init__ (self ):
4848 self .path = PricePath ()
4949
50- def __init__ (self ):
51- self .path = PricePath ()
52-
5350 def get_db_path (self , platform : str ) -> Path :
5451 return Path (config .DATA_PATH , f"{ platform } .db" )
5552
@@ -426,13 +423,13 @@ def get_cost(
426423
427424 def get_candles (self , start : int , stop : int , symbol : str , exchange : str ) -> list :
428425 exchange_class = getattr (ccxt , exchange )
429- exchange = exchange_class ()
430- if exchange .has ["fetchOHLCV" ]:
431- sleep (exchange .rateLimit / 1000 ) # time.sleep wants seconds
426+ exchange_obj = exchange_class ()
427+ if exchange_obj .has ["fetchOHLCV" ]:
428+ sleep (exchange_obj .rateLimit / 1000 ) # time.sleep wants seconds
432429 # get 2min before and after range
433430 startval = start - 1000 * 60 * 2
434431 rang = max (int ((stop - start ) / 1000 / 60 ) + 2 , 1 )
435- return exchange .fetch_ohlcv (symbol , "1m" , startval , rang )
432+ return list ( exchange_obj .fetch_ohlcv (symbol , "1m" , startval , rang ) )
436433 else :
437434 log .error (
438435 "fetchOHLCV not implemented on exchange, skipping priceloading using ohlcv"
0 commit comments