Implementation of "AlphaQCM: Alpha Discovery in Finance with Distributional Reinforcement Learning."
Requirements: Python 3.8, PyTorch 1.13.1, CUDA 11.6, and other dependencies. Please see alphaqcm_env.yml for more details.
In line with AlphaGen, we utilize the Qlib and baostock libraries to prepare locally stored stock data. After installing Qlib and baostock, run the script data_collection/fetch_baostock_data.py
to download the data.
Configure the agent's hyperparameters in qcm_config
and execute the following scripts to reproduce the results for AlphaQCM methods:
python train_qcm_csi300.py --model [qrdqn, iqn] --pool [10, 20, 50, 100] --std-lam [0.5, 1.0, 2.0]
python train_qcm_csi500.py --model [qrdqn, iqn] --pool [10, 20, 50, 100] --std-lam [0.5, 1.0, 2.0]
python train_qcm.py --model [qrdqn, iqn] --pool [10, 20, 50, 100] --std-lam [0.5, 1.0, 2.0]
The generated alpha pools are saved as human-readable CSV files. For additional baseline methods, refer to the code in AlphaGen.
This project is built upon AlphaGen and qf-iqn-qrdqn.pytorch. AlphaGen provides the alpha discovery environment, while qf-iqn-qrdqn.pytorch supports the distributional RL agent. We thank the contributors of these repositories.
Please feel free to raise an issue in this GitHub repository or email me if you have any questions or encounter any issues.