NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀...

57
NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授授授授 授授授 授授授 授授授

Transcript of NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀...

Page 1: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI

授課教師:楊婉秀報告人:李宗霖

Page 2: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Outline• Introduction

• Forecasting the Stock Market

• Neural Network and its Usage in the Stock Market

• A Case Study on the Forecasting of the KLCI

• Discussion

• Conclusion and Future Research

2

Page 3: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Introduction

3

Page 4: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Introduction• It is generally very difficult to forecast the movements of

stock markets.

• Artificial neural network is a well-tested method for financial analysis on the stock market.

4

Page 5: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Introduction• Using neural networks in equity market applications

include:

• Forecasting the value of a stock index

• Recognition of patterns in trading charts

• Rating of corporate bonds

• Estimation of the market price of options

• Indication of trading signals of selling and buying

5

Page 6: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Introduction• Feed-forward back propagation

• Without the use of extensive market data or knowledge useful prediction can be made and significant paper profit can be achieved.

6

Page 7: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Forecasting the Stock Market

7

Page 8: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Forecasting the Stock Market• There are three schools of thought in terms of the ability

to profit from the equity market.

• Random Walk Hypothesis & Efficient Market Hypothesis

• fundamental analysis

• Technical analysis

8

Page 9: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Forecasting the Stock Market• Use a variety of techniques to obtain multiple signals.

• Neural networks are often trained by both technical and fundamental indicators to produce trading signals.

9

Page 10: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Forecasting the Stock Market• For fundamental methods:

• retail sales

• gold prices

• industrial production indices

• foreign currency exchange rates

• For technical methods:

• delayed time series data

• technical indicators

10

Page 11: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Neural Network and its Usage in the Stock Market

11

Page 12: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

3.1 Neural networks• Neural networks

12

Page 13: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

3.2 Time series forecasting with neural networks

13

Page 14: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

3.2 Time series forecasting with neural networks• Three major steps in the neural network based forecasting

proposed in this research:

• Preprocessing

• Architecture

• Postprocessing

14

Page 15: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

3.3 Measurements of neural network training

• Normalized Mean Squared Error (NMSE)

• Signs

• Gradients

15

Page 16: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

• We argue that NMSE may not be the case for trading in the context of time series analysis.

3.3 Measurements of neural network training

16

Page 17: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

3.3 Measurements of neural network training

17

Page 18: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

A Case Study on the Forecasting of the KLCI

18

Page 19: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

A Case Study on the Forecasting of the KLCI• Kuala Lumpur Composite Index (KLCI)

• Neural networks are trained to approximate the market values.

• To find the hidden relationship between technical indicators and future KLCI.

19

Page 20: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Data choice and pre-processing

20

Page 21: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Data choice and pre-processing• The major types of indicators

• moving average (MA)

• momentum (M)

• Relative Strength Index (RSI)

• stochastics (%K)

• moving average of stochastics (%D)

21

Page 22: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Data choice and pre-processing

• inputs• It−1

• It

• MA5

• MA10

• MA50

• RSI• M• %K• %D

• output• It+1

22

Page 23: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Data choice and pre-processing• Normalization

23

Page 24: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Nonlinear analysis of the KLCI data

24

Page 25: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Nonlinear analysis of the KLCI data

25

Page 26: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Nonlinear analysis of the KLCI data

26

Page 27: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Neural network model building• Historical data are divided into three parts

• Training sets (2/3)

• Validation sets (2/15)

• Testing sets (3/15)

27

Page 28: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Neural network model building• A trade-off between convergence and generalization.

• Number of hidden nodes

28

Page 29: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Neural network model building

29

Page 30: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Neural network model building• Primary sensitive analysis is conducted for input

variables.

• Low influence factors: M20, M50, %K, %D

• High influence factors: It, RSI, M, MA5

• Chosen for input: It, MA5, MA10, RSI, M, It−1

30

Page 31: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Neural network model building

31

Page 32: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Neural network model building

32

Page 33: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Paper profits using neural network predictions

33

Page 34: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Paper profits using neural network predictions

34

Page 35: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Paper profits using neural network predictions• In a real situation, this might not be possible as some

indexed stocks may not be traded at all on some days.

• The transaction cost of a big fund trading, which will affect the market prices was not taken into consideration in the calculation of the “paper profit”.

35

Page 36: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Benchmark return comparison• Benchmark 1:

• Benchmark 2:

36

Page 37: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Benchmark return comparison• Benchmark 3:

37

Page 38: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Comparison with ARIMA• Autoregressive Integrated Moving Average (ARIMA)

Model

• Introduced by George Box and Gwilym Jenkins in 1976.

• Provided a systematic procedure for the analysis of time series that was sufficiently general to handle virtually all empirically observed time series data patterns.

• ARIMA(p, d, q)

38

Page 39: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

39

Page 40: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Discussion

40

Page 41: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Discussion• A very small NMSE does not necessarily imply good

generalization.

• Better testing results are demonstrated in the period near the end of the training sets.

• We have no data to test the “best” model.

• There are two approaches for using the forecasting result.

• best-so-far approach

• committee approach

41

Page 42: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Discussion• Measures

• NMSE

• Sign

• Gradient

• Four challenges

• inputs and outputs

• types of neural networks and the activation functions

• neural network architecture

• evaluate the quality of trained neural networks for forecasting

42

Page 43: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Conclusion and Future Research

43

Page 44: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Conclusion and Future Research• It shows that useful prediction could be made for KLCI

without the use of extensive market data or knowledge.

• It shows how a 26% annual return could be achieved by using the proposed model.

• It highlights the following problems associated with neural network based time series forecasting:

• the hit rate is a function of the time frame chosen for the testing sets;

• generalizability of the model over time to other period is weak;

• there should be some recency trade offs.

44

Page 45: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Conclusion and Future Research• A mixture of technical and fundamental factors as inputs

over different time periods should be considered.

• Sensitivity analysis should be conducted which can provide pointers to the refinement of neural network models.

• The characteristics of emerging markets such as KLCI should be further researched to facilitate better modeling of the market using neural networks.

45

Page 46: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Thanks for Your Listening

46

Page 47: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Forecasting the Stock Market• The research done here would be considered a violation

of the above two hypotheses above for short-term trading advantages in, Kuala Lumpur Stock Exchange (KLSE for short hereafter)

47

Page 48: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Forecasting the Stock Market• There are three schools of thought in terms of the ability

to profit from the equity market.

• The first school believes that no investor can achieve above average trading advantages based on the historical and present information.

• Random Walk Hypothesis

• Efficient Market Hypothesis

• Taylor provides compelling evidence to reject the random walk hypothesis and thus offers encouragement for research into better market prediction.

48

Page 49: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Forecasting the Stock Market• The second school's view is the so-called fundamental

analysis.

• It looks in depth at the financial conditions and operating results of a specific company and the underlying behavior of its common stock.

• In 1995 US$1.2 trillion of foreign exchange swapped hands on a typical day [10]. The number is roughly 50 times the value of the world trade in goods and services which should be the real fundamental factor.

49

Page 50: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Forecasting the Stock Market• Technical analysis belongs to the third school of thought.

• It attempts to use past stock price and volume information to predict future price movements.

• These five series are open price, close price, highest price, lowest price and trading volume.

• Most of the techniques used by technical analysts have not been shown to be statistically valid and many lack a rational explanation for their use

50

Page 51: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

• Normalized Mean Squared Error (NMSE)

• Signs

• Gradients

3.3 Measurements of neural network training

51

Page 52: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

3.3 Measurements of neural network training

• Normalized Mean Squared Error (NMSE)

52

Page 53: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

• Signs

3.3 Measurements of neural network training

53

Page 54: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

• Gradients

3.3 Measurements of neural network training

54

Page 55: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Data choice and pre-processing

55

Page 56: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Data choice and pre-processing

56

Page 57: NEURAL NETWORKS FOR TECHNICAL ANALYSIS: A STUDY ON KLCI 授課教師:楊婉秀 報告人:李宗霖.

Data choice and pre-processing

57