1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-06-06 05:51:17 +08:00

volume limit update

This commit is contained in:
wangwenxi.handsome
2021-08-01 16:03:08 +00:00
parent 5c2ddac7f0
commit 0f2d85d098
4 changed files with 132 additions and 123 deletions

View File

@@ -5,30 +5,7 @@ from qlib.data.ops import ElemOperator, PairOperator
from qlib.config import C
from qlib.data.cache import H
from qlib.data.data import Cal
def get_calendar_day(freq="day", future=False):
"""Load High-Freq Calendar Date Using Memcache.
Parameters
----------
freq : str
frequency of read calendar file.
future : bool
whether including future trading day.
Returns
-------
_calendar:
array of date.
"""
flag = f"{freq}_future_{future}_day"
if flag in H["c"]:
_calendar = H["c"][flag]
else:
_calendar = np.array(list(map(lambda x: pd.Timestamp(x.date()), Cal.load_calendar(freq, future))))
H["c"][flag] = _calendar
return _calendar
from qlib.contrib.ops.high_freq import get_calendar_day
class DayLast(ElemOperator):