Stock price prediction using ensemble MLP in PyTorch.
Predict the index changes by the fluctuation of index and volume in the last 5 days.
Train data is the daily CISSM (Compositional Index of Shenzhen Stock Market) from 2005/01 to 2015/06, the test data is from 2015/07 to 2017/05.
- Pytorch
- Numpy
- Pandas
- Matplotlib
- Run
train_net.py
to train a group of MLPs withsz_train.csv
, saved in/MLPs
. - Run
test_net.py
to predict stock market trend (insz_test.csv
) using ensemble MLP.
The train error rate (black) and test error rate (red) of a single MLP, changing with epoches.
The red line is asset sequence if we buy/sell CISSM-ETF according to our ensemble MLP, comparing with CISSM (black).
- Train samples are limited, using drop-out and early-stop to prevent overfitting.
- Simulated trading using this strategy, see https://xueqiu.com/P/ZH931230 .