This repository is the official implementation of "Discovering Predictable Latent Factors for Financial Time Series Forecasting".
Optional: include a graphic explaining your approach/main result, bibtex entry, link to demos, blog posts and tutorials
To install requirements and the Qlib toolkit:
# Install the requirements
pip install -r requirements.txt
# Install Qlib
pip install --upgrade cython
git clone https://github.com/microsoft/qlib.git && cd qlib
python setup.py install
# Download the stock features of Alpha360 from Qlib
python scripts/get_data.py qlib_data --target_dir ~/.qlib/qlib_data/cn_data --region cn --version v2
# CSI100
python train.py --data_set csi100 --K 0
# CSI300
python train.py --data_set csi300 --K 0
# CSI100
python train.py --data_set csi100
# CSI300
python train.py --data_set csi300
To evaluate my model on ImageNet, run:
# Ours+LR
python eval.py --model_path <path_to_model> --K 0 --data_set <csi100/csi300>
# Ours+HIST
python eval.py --model_path <path_to_model> --data_set <csi100/csi300>
The framework of our code is based on the code in "The HIST framework for stock trend forecasting" of the work "HIST: A Graph-based Framework for Stock Trend Forecasting via Mining Concept-Oriented Shared Information" by Xu et al. (WWW 2022).