1 development of neural network algorithms for predicting trading signals of stock market indices...

29
1 Development of Neural Network Algorithms for Predicting Trading Signals of Stock Market Indices Presented By: Nuha AlOjayan

Post on 19-Dec-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

1

Development of Neural Network Algorithms for

Predicting Trading Signals of Stock Market Indices

Presented By: Nuha AlOjayan

2

Overview

Paper Name:

Development of Neural Network Algorithms for Predicting Trading Signals of Stock Market Indices.

Authors:

Chandima D. Tilakaratne, Musa A. Mammadov, and Sidney A. Morris

Objective:

The aim of this paper is to develop new neural network algorithms to predict whether it is best to buy, hold or sell shares (trading signals) of stock market indices.

3

IntroductionThe most commonly used techniques to predict the trading signals of stock market indices are:

• Feed Forward Neural Networks (FNN) • Probabilistic Neural Networks (PNN)• Support Vector Machines (SVM)

The FNN outputs the value of the stock market index and subsequently this value is classified into classes (direction).

Unlike FNN, PNN and SVM directly output the corresponding class.

Almost all of these studies considered only two classes the upward and the downward trend of the stock market movement, which were considered as buy and sell signals.

4

Introduction

• It was noticed that the time series data used for these studies are approximately symmetrically distributed among these two classes.

• In practice, the traders do not participate in trading (either buy or sell shares) if there is no substantial change in the price level. Instead of buying/selling, they will hold the money/shares in hand.

Where Y (t+1) is the relative return of the Close price of day (t+1) of the stock market index of interest while lu and ll are two thresholds.

5

Introduction

FNN can be identified as a suitable alternative technique for classification when the data to be studied has an imbalanced distribution.

FNN Disadvantages:

• Use of local optimization methods which do not guarantee a deep local optimal solution

• FNN needs to be trained many times with different initial weights

• Use of the ordinary least squares (OLS) as an error function to be minimized may not be suitable for classification problems.

6

Introduction

This study aims at developing new neural network algorithms to predict the

trading signals: buy, hold and sell, of a given stock market index.

• Using a global optimization algorithm for network training to find deep solutions to the error function.

• Modifying the ordinary least squares error function to be suitable for the classification problem. (It is more important to predict the direction of a time series rather than its value. Therefore, the minimization of the absolute errors between the target and the output may not produce the desired accuracy of predictions)

7

Development of New Algorithms

The most commonly used error function is the Ordinary Least Squares function (OLS):

Where N is the total number of observations in the training set while ai and oi are the target and the output corresponding to the ith observation in the training set

8

Alternative Error Functions • Caldwell and Yao & Tan Function

It penalized the incorrectly predicted directions more heavily, than the correct predictions. In other words, higher penalty was applied if the predicted value (oi) is negative when the target (ai) is positive or vice-versa.

Caldwell proposed the Weighted Directional Symmetry (WDS) function which is given below:

N is the total number of observations

9

Alternative Error Functions

• Yao & Tan

wds(i) should be heavily adjusted if a wrong direction is predicted for a larger change while it should be slightly adjusted if a wrong direction is predicted for a smaller change and so on.

Based on this argument, they proposed the Directional Profit adjustment factor:

Where Δai=ai−ai−1, Δoi=oi−oi−1 and is the standard deviation of the training data.

10

Alternative Error Functions

• Based on this, they propose Directional Profit (DP) model

• They proposed Discounted Least Squares (LDS) function by taking the recency of the observations into account.

Where wb(i) is an adjustment relating to the contribution of the ith observation and is described by the following equation:

11

Alternative Error Functions

• Yao & Tan proposed another error function, Time Dependent Directional Profit (TDP) model

Where fTDP (i)=fDP (i) × wb(i).

12

Modified Error Functions

• The authors in this paper are interested in classifying trading signals into three classes: buy, hold and sell.

• The hold class includes both positive and negative values. Therefore, the least squares functions in which the cases with incorrectly predicted directions (positive or negative) are penalized will not give the desired prediction accuracy.

• They proposed scheme based on the correctness of the classification of trading signals.

• If the predicted trading signal is correct, we assign a very small (close to zero) weight

• otherwise, assign a weight equal to 1

13

Proposed Error Function 1

• Modify EDP error function by replacing fDP (i) with the new weighing scheme, wd(i)

14

Proposed Error Function 2

• Combine ECC with the EDLS

15

New Neural Network Algorithms

• The authors proposed the following algorithms:

• NNOLS - Neural network algorithm based on Ordinary Least Squares error function, EOLS

• NNDLS - Neural network algorithm based on Discounted Least Squares error function, EDLS

• NNCC - Neural network algorithm based on the ECC

• NNTCC Neural network algorithm based on the ETCC

These networks consist of three layers and out of these three one is a hidden layer.

A tan-sigmoid function was used as the transfer function between the input layer and the hidden layer while the linear transformation function was employed between the hidden and the output layers.

16

Network Training and Evaluation

• The Australian All Ordinary Index (AORD) was selected as the stock market index whose trading signals are to be predicted.

• Input Sets:

(1) A combination includes the GSPC, FTSE, FCHI and the GDAXI;

(2) A combination which includes the AORD in addition to the markets included in (1).

17

Optimization Problem

Let Y (t+1) be the relative return of the Close price of a selected dependent market at time t + 1 and Xj(t) be the relative return of the Close price of the jth influential market at time t. Define X(t) as:

Where the coefficient j = 1, 2, ...,m, measures the strength of influence from each influential market Xj while m is the total number of influential markets.

18

Input Sets

• The following six sets of inputs were used to train the new network:

• Four input features of the relative returns of the Close prices of day t of the market combination (1) (that is GSPC(t), FTSE(t), FCHI(t), GDAXI(t));

• Four input features of the quantified relative returns of the Close prices of day t of the market combination (1) (that is ξ1GSPC(t), ξ2FTSE(t), ξ3FCHI(t), ξ4GDAXI(t));

• Single input feature consists of the sum of the quantified relative returns of the Close prices of day t of the market combination (1) (that is ξ1GSPC(t)+ ξ2FTSE(t)+ ξ3FCHI(t) + ξ4GDAXI(t));

• Five input features of the relative returns of the Close prices of day t of the market combination (2) (that is GSPC(t), FTSE(t), FCHI(t), GDAXI(t), AORD(t));

• Five input features of the quantified relative returns of the Close prices of day t of the market combination (2) (that is ξ1GSPC(t), ξ2 FTSE(t), ξ3 FCHI(t), ξ4 GDAXI(t), ξ5 AORD(t));

• Single input feature consists of the sum of the quantified relative returns of the Close prices of day t of the market combination (2) (that is ξ1 GSPC(t)+ξ2 FTSE(t)+ξ3 FCHI(t) +ξ4 GDAXI(t)+ξ5 AORD(t)).

19

Evaluation Measures

• The overall classification rate (rCA)

Where N0 and NT are the number of test cases with correct predictions and the total number of cases in the test sample, respectively

• The overall misclassification rates (rE1 and rE2)

Where N1 is the number of test cases where a buy/sell signal is misclassified as a hold signals or vice versa. N2 is the test cases where a sell signal is classified as a buy signal and vice versa.

• The performance of the networks was evaluated by:

From a trader’s point of view, the misclassification of a hold signal as a buy or sell signal is a more serious mistake than misclassifying a buy signal or a sell signal as a hold signal.

20

Trading Simulations

• Two types of trading simulations were used:

• Response to the predicted trading signals which might be a buy, hold or a sell signal;

• Do not participate in trading but hold the initial shares in hand, and keep the

money in hand until the end of the period.

21

First Trading Simulation

• Let the value of the initial money in hand be M0 and the number of shares at the beginning of the period be S0.

• S0 = M0/P0, where P0 is the Close price of the AORD on the day before the starting day of the trading period.

• Also let Mt, St, Pt, V St be the money in hand, number of shares, Close price of the AORD, value of shares holding on the day t (t=1, 2, ..., T), respectively.

• This simulation assumes that always a fixed amount of money is used in trading regardless of whether the trading signal is buy or sell.

• Suppose the trading signal at the beginning of the day t is a buy signal. Then the trader spends F =min{F0,Mt−1} amount of money to buy a number of shares at a rate of the previous day’s Close price.

22

First Trading Simulation

Suppose the trading signal is a hold signal, then:

23

First Trading Simulation

• Let the trading signal at the beginning of the day t is a sell signal. Then the trader sells S0=min{(F0/Pt−1), St−1} amount of shares.

• At the end of the period (day T) the total value of money and shares in hand:

24

Second Trading Simulation

• In this case the trader does not participate in trading. Therefore, Mt = M0 and St = S0 for all t=1, 2, ..., T. However, the value of the shares changes with the time and therefore, the value of shares at day t, V St = S0 × Pt.

At the end of the period (day T) the total value of money and shares in hand:

25

Results Obtained from Network Training

Results obtained from training neural network, NNTCC Results obtained from training neural network, NNCC

Results obtained from training neural network, NNDLSResults obtained from training neural network, NNOLS

26

Comparison of the Performance of the New Algorithms

Average (over six windows) Classification/ Misclassification rates of the best prediction results corresponding to NNOLS

Average (over six windows) Classification/ Misclassification rates of the best prediction results corresponding to NNDLS

27

Comparison of the Performance of the New Algorithms

Average (over six windows) Classification/Misclassification rates of the best prediction results corresponding to NNCC

Average (over six windows) Classification/Misclassification rates of the best prediction results corresponding to NNTCC

28

Trading Simulations

Average rate of return (over six windows) obtained by performing the first trading simulation on the best prediction results produced by each neural network algorithm

29

Conclusions

• The results obtained from the experiments show that the neural network algorithms, based on the modified OLS error functions introduced by this study produced better predictions of trading signals of the AORD.

• Of the two algorithms, the one based on ETCC showed the better performance.

• This network prevented serious misclassifications such as misclassification of buy signals to sell signals and vice versa and also predicted trading signals with a higher degree of accuracy.

• The algorithms proposed in this paper can be used to predict the trading signals, buy, hold and sell, of any given stock market index or a sector of a stock market index.