StockFormer
PyTorch implementation for Paper "StockFormer: Learning Hybrid Trading Machines with Predictive Coding".
Install / Use
/learn @gsyyysg/StockFormerREADME
StockFormer (IJCAI'23)
Code repository for this paper:
StockFormer: Learning Hybrid Trading Machines with Predictive Coding.
Siyu Gao, Yunbo Wang<sup>†</sup>, Xiaokang Yang
Preparation
Installation
git clone https://github.com/gsyyysg/StockFormer.git
cd StockFormer
pip install -r requirements.txt
Dataset
Downloaded from YahooFinance
Experiment
Data
dir: 'data/CSI/'
Code
dir:'code/'
1st stage:Representation Learning
1)Relational state inference module training:
cd code/Transformer/script
sh train_mae.sh
2)Long-term state inference module training:
cd code/Transformer/script
sh train_pred_long.sh
- Short-term state inference module training:
cd code/Transformer/script
sh train_pred_short.sh
- Select the best model of three state inference modules from 'code/Transformer/checkpoints/' according to their performance on validation set and add them to 'code/Transformer/pretrained/'
OR directly use the model which have been pretrained in advance by us (dir:'code/Transformer/pretrained/csi/ ')
2nd stage:Policy Learning
- train SAC model (three state inference module's path can be changed in train_rl.py file)
python train_rl.py
- get prediction result on test set from 'code/results/df_print/'
Citation
If you find our work helps, please cite our paper.
@inproceedings{gaostockformer,
title={StockFormer: Learning Hybrid Trading Machines with Predictive Coding},
author={Gao, Siyu and Wang, Yunbo and Yang, Xiaokang},
booktitle={IJCAI},
year={2023}
}
Acknowledgements
This codebase is based on FinRL.
Related Skills
YC-Killer
2.7kA library of enterprise-grade AI agents designed to democratize artificial intelligence and provide free, open-source alternatives to overvalued Y Combinator startups. If you are excited about democratizing AI access & AI agents, please star ⭐️ this repository and use the link in the readme to join our open source AI research team.
best-practices-researcher
The most comprehensive Claude Code skills registry | Web Search: https://skills-registry-web.vercel.app
mentoring-juniors
Community-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot.
groundhog
399Groundhog's primary purpose is to teach people how Cursor and all these other coding agents work under the hood. If you understand how these coding assistants work from first principles, then you can drive these tools harder (or perhaps make your own!).
