How to utilize transformer in quantitative financial trading? Here we provide a new model named Quantformer based on the transformer.
The official implementation code of the work is available now!
The training and backtesting data are collected from AKShare and TuShare from 2010 to 2019. For each stock, the adjusted cumulated return and cumulated turnover rate in the setting timestamp will be collected (if training model by return directly, the result may be influenced).
The code of the model is shown in quantformer. If necessary, we will upload the code in a py file.
The model is run in Python 3.8.3 (64-bit), torch version is 2.1.0+cpu and numpy version is 1.23.1. We are not sure if it will work properly under a lower version.
Before the first trade date of the timestamp
If feels difficult to backtest, JoinQuant could be a considerable platform to help you with computation. By importing selected IDs of stocks, JoinQuant can simulate trading and show results to you.
Transaction fee: 0.3% for each time long or short
Trading period: 01/2020-05/2023
Adjusted time: 9:30 am BJT (ITC+08)
We are willing to collaborate and discuss this topic with those interested. If you want to further connect, you can contact the corresponding author via the paper in ArXiv by mail [email protected].
Our paper: Quantformer: from attention to profit with a quantitative transformer trading strategy (which had been From attention to profit: quantitative trading strategy based on transformer) is available at arXiv.
@unpublished{zhang2024attention,
title={Quantformer: from attention to profit with a quantitative transformer trading strategy},
author={Zhang, Zhaofeng and Chen, Banghao and Zhu, Shengxin and Langren{\'e}, Nicolas},
note={arXiv:2404.00424},
year={2024}
}