Move all Qt components into top level ui module
parent
82a5daf91b
commit
0b5af4b590
|
@ -115,6 +115,6 @@ def optschain(config, symbol, date, tl, rate, test):
|
|||
def chart(config, symbol, date, tl, rate, test):
|
||||
"""Start an option chain UI
|
||||
"""
|
||||
from .qt._chart import main
|
||||
from ._chart import main
|
||||
|
||||
main(symbol)
|
||||
|
|
|
@ -89,6 +89,7 @@ class BaseQuotes(np.recarray):
|
|||
return self
|
||||
|
||||
def convert_dates(self, dates):
|
||||
breakpoint()
|
||||
return np.array([d.timestamp().time for d in dates])
|
||||
|
||||
|
|
@ -62,14 +62,18 @@ class QuotesLoader:
|
|||
@classmethod
|
||||
def _save_to_disk(cls, fpath, data):
|
||||
logger.debug('Saving quotes to a file: %s', fpath)
|
||||
breakpoint()
|
||||
with open(fpath, 'wb') as f:
|
||||
pass
|
||||
pickle.dump(data, f, pickle.HIGHEST_PROTOCOL)
|
||||
d = pickle.load(f)
|
||||
|
||||
@classmethod
|
||||
def _load_from_disk(cls, fpath):
|
||||
logger.debug('Loading quotes from a file: %s', fpath)
|
||||
with open(fpath, 'rb') as f:
|
||||
return pickle.load(f)
|
||||
breakpoint()
|
||||
data = pickle.load(f)
|
||||
|
||||
@classmethod
|
||||
@timeit
|
||||
|
@ -84,10 +88,11 @@ class QuotesLoader:
|
|||
|
||||
quotes = None
|
||||
fpath = cls._get_file_path(symbol, cls.timeframe, date_from, date_to)
|
||||
if os.path.exists(fpath):
|
||||
quotes = Quotes.new(cls._load_from_disk(fpath))
|
||||
else:
|
||||
# if os.path.exists(fpath):
|
||||
# quotes = Quotes.new(cls._load_from_disk(fpath))
|
||||
# else:
|
||||
quotes_raw = cls._get(symbol, date_from, date_to)
|
||||
breakpoint()
|
||||
quotes = Quotes.new(
|
||||
quotes_raw, source=cls.source, default_tf=cls.default_tf
|
||||
)
|
Loading…
Reference in New Issue