Giter Club home page Giter Club logo

stockformer's Introduction

StockFormer (IJCAI'23)

Code repository for this paper:
StockFormer: Learning Hybrid Trading Machines with Predictive Coding.
Siyu Gao, Yunbo Wang, 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
  1. Short-term state inference module training:
cd code/Transformer/script
sh train_pred_short.sh
  1. 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

  1. train SAC model (three state inference module's path can be changed in train_rl.py file)
python train_rl.py
  1. 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.

stockformer's People

Contributors

gsyyysg avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.