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