(
self,
instruments="csi500",
start_time=None,
end_time=None,
freq="day",
infer_processors=_DEFAULT_INFER_PROCESSORS,
learn_processors=_DEFAULT_LEARN_PROCESSORS,
fit_start_time=None,
fit_end_time=None,
filter_pipe=None,
inst_processors=None,
**kwargs,
)
| 47 | |
| 48 | class Alpha360(DataHandlerLP): |
| 49 | def __init__( |
| 50 | self, |
| 51 | instruments="csi500", |
| 52 | start_time=None, |
| 53 | end_time=None, |
| 54 | freq="day", |
| 55 | infer_processors=_DEFAULT_INFER_PROCESSORS, |
| 56 | learn_processors=_DEFAULT_LEARN_PROCESSORS, |
| 57 | fit_start_time=None, |
| 58 | fit_end_time=None, |
| 59 | filter_pipe=None, |
| 60 | inst_processors=None, |
| 61 | **kwargs, |
| 62 | ): |
| 63 | infer_processors = check_transform_proc(infer_processors, fit_start_time, fit_end_time) |
| 64 | learn_processors = check_transform_proc(learn_processors, fit_start_time, fit_end_time) |
| 65 | |
| 66 | data_loader = { |
| 67 | "class": "QlibDataLoader", |
| 68 | "kwargs": { |
| 69 | "config": { |
| 70 | "feature": Alpha360DL.get_feature_config(), |
| 71 | "label": kwargs.pop("label", self.get_label_config()), |
| 72 | }, |
| 73 | "filter_pipe": filter_pipe, |
| 74 | "freq": freq, |
| 75 | "inst_processors": inst_processors, |
| 76 | }, |
| 77 | } |
| 78 | |
| 79 | super().__init__( |
| 80 | instruments=instruments, |
| 81 | start_time=start_time, |
| 82 | end_time=end_time, |
| 83 | data_loader=data_loader, |
| 84 | learn_processors=learn_processors, |
| 85 | infer_processors=infer_processors, |
| 86 | **kwargs, |
| 87 | ) |
| 88 | |
| 89 | def get_label_config(self): |
| 90 | return ["Ref($close, -2)/Ref($close, -1) - 1"], ["LABEL0"] |
no test coverage detected