microsoft / qlib

Qlib is an AI-oriented quantitative investment platform that aims to realize the potential, empower research, and create value using AI technologies in quantitative investment, from exploring ideas to implementing productions. Qlib supports diverse machine learning modeling paradigms. including supervised learning, market dynamics modeling, and RL.
https://qlib.readthedocs.io/en/latest/
MIT License
15.49k stars 2.64k forks source link

Monthly Task RollingGen #1288

Open pop0121 opened 2 years ago

pop0121 commented 2 years ago

🌟 Feature Description

Is it possible to provide a way to rolling train the model (and consequently, the backtest) at an irregular interval (e.g., weekly or monthly).

Sorry to post it if there is already a way to do it in qlib.

Motivation

Alternatives

Additional Notes

you-n-g commented 1 year ago

The default implementation is a fixed_step version. But it is free for users to customize its task generator for flexible interval Users can implement a rolling generator by overriding this function. And then it will be used in https://github.com/microsoft/qlib/blob/144e1e2459ca072052945a66628b5710774a21b3/qlib/workflow/online/strategy.py#L189

pop0121 commented 1 year ago

Thanks for you suggestiong.

I am trying to figure out if it is possible to do this by modifying the executor. I always try to avoid using task generator due to limited hardware resources, though it seems to be a good practice to parallelize different task settings.

I have managed to run a rolling-test backtest by following the example on "rolling dataset" instead of "rolling task". But, as another post says, it seems that the backtest part of qlib is not as well documented as the other parts.