| Literature DB >> 32275721 |
Jinho Lee1, Jaewoo Kang1.
Abstract
We propose a novel method for training neural networks to predict the future prices of stock indexes. Unlike previous works, we do not use target stock index data for training neural networks for index prediction. Instead, we use only the data of individual companies to obtain sufficient amount of data for training neural networks for stock index prediction. As a result, our method can avoid various problems due to training complex machine learning models on a small amount of data. We performed numerous types of experiments to test methods designed for predicting the future price of the S&P 500 which is one of the most commonly traded stock indexes. Our experiments show that neural networks trained using our method outperform neural networks trained on stock index data. Compared with other state-of-the-art methods, our method is conceptually simpler and easier to apply, and achieves better results. We obtained approximately a 5-16% annual return before transaction costs during the test period (2006-2018).Entities:
Year: 2020 PMID: 32275721 PMCID: PMC7147736 DOI: 10.1371/journal.pone.0230635
Source DB: PubMed Journal: PLoS One ISSN: 1932-6203 Impact factor: 3.240
Training, validation, and test periods.
| Method | Training | alidation | Test |
|---|---|---|---|
| Ours | 2000—2004 | 2004—2006 | 2006—2010 |
| 2004—2008 | 2008—2010 | 2010—2014 | |
| 2008—2012 | 2012—2014 | 2014—2018 | |
| Baseline | 1996—2004 | 2004—2006 | 2006—2010 |
| 2000—2008 | 2008—2010 | 2010—2014 | |
| 2004—2012 | 2012—2014 | 2014—2018 |
The data used for generating input x and answer y.
“IND” and “S&P500” denote the data of individual companies and the data of the S&P 500, respectively.
| Method | Training | Validation | Test | |
|---|---|---|---|---|
| Ours | Input x | IND | IND | IND |
| Answer y | IND | IND | S&P500 | |
| Baseline | Input x | S&P500 | S&P500 | S&P500 |
| Answer y | S&P500 | S&P500 | S&P500 |
Fig 1Overview of how the target NNs read input and output ρt.
Eight different target NNs with different possible combinations of types of NNs (NNs), learning algorithms (Algs) and input features (Features).
The notation of each target NN is listed in the first column. The shape of input xt and the shape of answer yt are listed in the last two columns, respectively. The shape (W) denotes a vector with a length of W, and the shape (W,W) denotes a W by W matrix.
| Notations | NNs | Algs | Features | Shape xt | Shape yt |
|---|---|---|---|---|---|
| MLP | SL | Price | (W) | (3) | |
| MLP | SL | Price, Volume | (2W) | (3) | |
| MLP | RL | Price | (W) | (1) | |
| MLP | RL | Price, Volume | (2W) | (1) | |
| CNNs | SL | Price | (W, W) | (3) | |
| CNNs | SL | Price, Volume | (W, W) | (3) | |
| CNNs | RL | Price | (W, W) | (1) | |
| CNNs | RL | Price, Volume | (W, W) | (1) |
Fig 2The shapes of input xt for MLP and CNN, respectively.
List of hyper-parameters and their values used while training.
| Algo | Notations | Description | Values |
|---|---|---|---|
| SL | β | The batch size | 64 |
| The maximum number of iterations | 200,000 | ||
| The learning rate | 0.001 | ||
| RL | M | The size of the memory buffer | 1,000 |
| B | The update interval of parameters θ | 10 | |
| C | The update interval of parameters θ* | 1,000 | |
| P | The transaction penalty | 0.1 | |
| β | The batch size | 32 | |
| The discount factor | 0.99 | ||
| The maximum number of iterations | 3,000,000 | ||
| The learning rate | 0.00001 |
Sixteen target NNs with different learning algorithms (Algs) and network structures.
The first column lists the notation of each NN. The network structures (MSp, MRp, CSp, and CRp) used in the previous experiments are highlighted. The column Layers lists the number of fully connected layers of MLP and the number of convolutional layers for CNN. The column Units/Filters lists the number of units in the hidden layers of MLP and the number of filters in the convolutional layers of CNN. The columns Ours and Baseline list the cumulative assets obtained by the target NNs over the entire test period.
| Notation | NNs | Algs | Layers | Units / Filters | Ours | Baseline |
|---|---|---|---|---|---|---|
| MSP1 | MLP | SL | 4 | 128, 64, 32, 3 | 2.18 | 1.31 |
| MSP2 | MLP | SL | 3 | 64, 32, 3 | 6.7 | 2.57 |
| MSP3 | MLP | SL | 3 | 128, 64, 3 | 4.48 | 1.82 |
| MRP1 | MLP | RL | 4 | 128, 64, 32, 3 | 3.45 | 1.27 |
| MRP2 | MLP | RL | 3 | 64, 32, 3 | 5.0 | 1.62 |
| MRP3 | MLP | RL | 3 | 128, 64, 3 | 6.04 | 1.16 |
| CSP1 | CNNs | SL | 4 | 16, 16, 32, 32 | 2.28 | 1.07 |
| CSP2 | CNNs | SL | 2 | 16, 32 | 2.72 | 0.38 |
| CSP3 | CNNs | SL | 2 | 32, 64 | 1.24 | 0.71 |
| CRP1 | CNNs | RL | 4 | 16, 16, 32, 32 | 2.92 | 1.3 |
| CRP2 | CNNs | RL | 2 | 16, 32 | 3.84 | 0.98 |
| CRP3 | CNNs | RL | 2 | 32, 64 | 4.79 | 1.0 |
Fig 3Overview of how ηt is aggregated from the outputs of individual companies ρit.
Fig 4Cumulative assets obtained by target NNs trained using RL.
Cumulative assets obtained over the entire test period. The notations and final assets are listed at the right side of the figure.
Fig 5Cumulative assets obtained by target NNs trained using SL.
Cumulative assets obtained over the entire test period. The notations and final assets are listed at the right side of the figure.
Comparison of the total profit gained by our method and that obtained by the method proposed in [13].
The profit is summed over the entire test period (Jun. 5, 2006-Dec. 29, 2017). “Average” denotes the average profit.
| Notations | Profit | |
|---|---|---|
| Ours | ||
| 1.527 | ||
| 0.869 | ||
| Jeong & Kim | 0.925 | |
| 1.039 | ||
| 1.431 | ||
| 1.292 | ||
| 1.076 | ||
Comparison of the annual returns and returns per transaction of our method and those of the baseline.
The columns Return, TR, Long, and perTR list the annual returns in percentage, the number of transactions per year, the Long to Short position ratio, and the returns per transaction, respectively. The results are averaged over the entire test period.
| Notations | cumAsset | Return (%) | TR | Long | perTR (%) | |
|---|---|---|---|---|---|---|
| Ours | CRP | 5.78 | 17.04 | 37.99 | 0.46 | 0.45 |
| CRPV | 1.78 | 6.89 | 42.4 | 0.42 | 0.16 | |
| MRP | 3.98 | 13.82 | 58.96 | 0.44 | 0.23 | |
| MRPV | 2.29 | 9.05 | 51.8 | 0.42 | 0.16 | |
| CSP | 5.20 | 16.12 | 91.05 | 0.47 | 0.18 | |
| CSPV | 1.35 | 4.49 | 89.85 | 0.47 | 0.05 | |
| MSP | 1.98 | 7.74 | 111.84 | 0.44 | 0.07 | |
| MSPV | 1.96 | 7.75 | 105.06 | 0.47 | 0.07 | |
| Baseline | CRP | 0.54 | -3.67 | 83.39 | 0.48 | -0.04 |
| CRPV | 0.72 | -1.67 | 77.39 | 0.32 | -0.02 | |
| MRP | 0.82 | -0.16 | 78.46 | 0.43 | 0.0 | |
| MRPV | 0.64 | -2.27 | 91.19 | 0.54 | -0.03 | |
| CSP | 0.52 | -4.21 | 97.7 | 0.48 | -0.04 | |
| CSPV | 1.21 | 2.97 | 94.38 | 0.57 | 0.03 | |
| MSP | 1.38 | 4.24 | 101.76 | 0.49 | 0.04 | |
| MSPV | 0.53 | -3.86 | 95.33 | 0.47 | -0.04 |
The averaged results obtained using the function laggedPosChange for the target NNs trained on the data of individual companies (Ours).
The column TRCost and the column cumAsset list the transaction costs and cumulative assets, respectively. The column NNP and the column MDD list the non-neutral position ratios and Maximum Drawdowns, respectively.
| Algo | τw | τs | TRCost | cumAsset | return (%) | TR | perTR (%) | Long | NNP | MDD |
|---|---|---|---|---|---|---|---|---|---|---|
| RL | 0 | 0 | 0 | 3.46 | 11.7 | 47.79 | 0.25 | 0.44 | 1 | -21.93 |
| 0 | 0.25 | 0 | 3.37 | 11.72 | 36.65 | 0.33 | 0.42 | 0.69 | -18.67 | |
| 0 | 0.50 | 0 | 3.28 | 11.34 | 28.79 | 0.4 | 0.42 | 0.58 | -17.39 | |
| 0 | 0.75 | 0 | 2.56 | 8.98 | 21.74 | 0.42 | 0.41 | 0.47 | -16.45 | |
| 0 | 0 | 0.1 | 2.02 | 6.92 | 47.79 | 0.15 | 0.44 | 1 | -24.83 | |
| 0 | 0.25 | 0.1 | 2.2 | 8.05 | 36.65 | 0.23 | 0.42 | 0.69 | -21.4 | |
| 0 | 0.50 | 0.1 | 2.33 | 8.46 | 28.79 | 0.3 | 0.42 | 0.58 | -19.02 | |
| 0 | 0.75 | 0.1 | 1.98 | 6.81 | 21.74 | 0.32 | 0.41 | 0.47 | -17.46 | |
| SL | 0 | 0 | 0 | 2.62 | 9.03 | 99.44 | 0.09 | 0.46 | 1 | -25.86 |
| 0 | 0.25 | 0 | 2.58 | 8.97 | 75.09 | 0.12 | 0.46 | 0.63 | -20.18 | |
| 0 | 0.50 | 0 | 2.6 | 9.02 | 58.79 | 0.15 | 0.47 | 0.51 | -18.68 | |
| 0 | 0.75 | 0 | 2.26 | 7.87 | 44.43 | 0.18 | 0.47 | 0.4 | -18.63 | |
| 0 | 0 | 0.1 | 0.85 | -0.92 | 99.44 | -0.01 | 0.46 | 1 | -34.39 | |
| 0 | 0.25 | 0.1 | 1.09 | 1.47 | 75.09 | 0.02 | 0.46 | 0.63 | -26.1 | |
| 0 | 0.50 | 0.1 | 1.31 | 3.14 | 58.79 | 0.05 | 0.47 | 0.51 | -21.99 | |
| 0 | 0.75 | 0.1 | 1.34 | 3.43 | 44.43 | 0.08 | 0.47 | 0.4 | -21.15 |
Fig 6Cumulative assets over the entire test period.
Comparison of the cumulative assets obtained by sixteen different target NNs. Cumulative assets obtained by the target NNs trained on the data of individual companies (our method) are highlighted in red. Cumulative assets obtained by the target NNs trained on the data of the S&P 500 (baseline method) are highlighted in blue.