Qlib Highfreq Support & Highfreq DataHanlder/Operator/Processor Examples#222
Qlib Highfreq Support & Highfreq DataHanlder/Operator/Processor Examples#222you-n-g merged 18 commits intomicrosoft:mainfrom
Conversation
qlib/data/data.py
Outdated
| H["c"][flag] = _calendar, _calendar_index | ||
| return _calendar, _calendar_index | ||
|
|
||
| def get_calendar_day(self, freq="day", future=False): |
There was a problem hiding this comment.
get_calendar_day just for high-freq, if there are other ways to implement it
There was a problem hiding this comment.
We don't need to put this in qlib/data/data.py
qlib/data/data.py
Outdated
| H["c"][flag] = _calendar, _calendar_index | ||
| return _calendar, _calendar_index | ||
|
|
||
| def get_calendar_day(self, freq="day", future=False): |
There was a problem hiding this comment.
We don't need to put this in qlib/data/data.py
examples/high_freq/workflow.py
Outdated
| # use default data | ||
| provider_uri = "/nfs_data/qlib_data/yahoo_high_qlib" # target_dir | ||
| qlib.init( | ||
| provider_uri=provider_uri, |
examples/high_freq/workflow.py
Outdated
| qlib.init( | ||
| provider_uri=provider_uri, | ||
| custom_ops=[DayFirst, DayLast, FFillNan, Date, Select, IsNull], | ||
| redis_port=-1, |
There was a problem hiding this comment.
Default in most case
- Enable expression cache , disable dataset cache.
examples/high_freq/workflow.py
Outdated
| qlib.init( | ||
| provider_uri=provider_uri, | ||
| custom_ops=[DayFirst, DayLast, FFillNan, Date, Select, IsNull], | ||
| redis_port=-1, |
There was a problem hiding this comment.
disable expression cache in this case
examples/high_freq/workflow.py
Outdated
| # use default data | ||
| provider_uri = "/nfs_data/qlib_data/yahoo_high_qlib" # target_dir | ||
| qlib.init( | ||
| provider_uri=provider_uri, |
There was a problem hiding this comment.
SPEC_CONF
HIGH_FREQ_CONFIG
``qlib.init(**HIGH_FREQ_CONFIG, **SPEC_CONF)`
examples/high_freq/workflow.py
Outdated
| # use default data | ||
| provider_uri = "/nfs_data/qlib_data/yahoo_high_qlib" # target_dir | ||
| qlib.init( | ||
| provider_uri=provider_uri, |
There was a problem hiding this comment.
provider_uri in HIGH_FREQ_CONFIG
| if DROP_LOAD_DATASET: | ||
|
|
||
| ##=============dump dataset============= | ||
| dataset.to_pickle(path="dataset.pkl") |
There was a problem hiding this comment.
import fire
class HFWorkflow:
def XXXX
def case1:
def case2:
| fields += [ | ||
| "{0}/Ref(DayLast({1}), 240)".format( | ||
|
|
||
| def get_04_price_feature(price_field): |
There was a problem hiding this comment.
get_04_price_feature & get_59_price_feature are really weird names.
examples/highfreq/highfreq_ops.py
Outdated
| class FFillNan(ElemOperator): | ||
| def __init__(self, feature): | ||
| super(FFillNan, self).__init__(feature, "fill_nan") | ||
| super(FFillNan, self).__init__(feature) |
There was a problem hiding this comment.
These init function are no longer required.
examples/highfreq/workflow.py
Outdated
| provider_uri = QLIB_INIT_CONFIG.get("provider_uri") | ||
| if not exists_qlib_data(provider_uri): | ||
| print(f"Qlib data is not found in {provider_uri}") | ||
| sys.path.append(str(Path(__file__).resolve().parent.parent.parent.joinpath("scripts"))) |
There was a problem hiding this comment.
from qlib.tests.data import GetData
examples/workflow_by_code.py
Outdated
| GetData().qlib_data(target_dir=provider_uri, region=REG_CN) | ||
|
|
||
| qlib.init(provider_uri=provider_uri, region=REG_CN) | ||
| qlib.init(provider_uri=provider_uri, region=REG_CN, redis_port=-1) |
Qlib Highfreq Support & Highfreq DataHanlder/Operator/Processor Examples
Description
Qlib Highfreq Support & Highfreq DataHanlder/Operator/Processor Examples
Motivation and Context
How Has This Been Tested?
pytest qlib/tests/test_all_pipeline.pyunder upper directory ofqlib.Screenshots of Test Results (if appropriate):
Types of changes