forecasting stock price index using artificial neural networks in the indonesian … ·...

13
THESIS Forecasting Stock Price Index Using Artificial Neural Networks in the Indonesian Stock Exchange SOUKKHY TIPHIMMALA Sdut.Id: 125001870/PS/MM PROGRAM STUDY MASTER MANAGEMENT PROGRAM GRADUATE UNIVERSITY OF ATMA JAYA YOGYAKARTA 2014

Upload: others

Post on 15-Aug-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Forecasting Stock Price Index Using Artificial Neural Networks in the Indonesian … · 2016-05-25 · technical indicators, such as A/D Oscillator, Moving Average, RSI, CCI, MACD,

THESIS

Forecasting Stock Price Index Using Artificial Neural

Networks in the Indonesian Stock Exchange

SOUKKHY TIPHIMMALA

Sdut.Id: 125001870/PS/MM

PROGRAM STUDY MASTER MANAGEMENT

PROGRAM GRADUATE

UNIVERSITY OF ATMA JAYA YOGYAKARTA

2014

Page 2: Forecasting Stock Price Index Using Artificial Neural Networks in the Indonesian … · 2016-05-25 · technical indicators, such as A/D Oscillator, Moving Average, RSI, CCI, MACD,
Page 3: Forecasting Stock Price Index Using Artificial Neural Networks in the Indonesian … · 2016-05-25 · technical indicators, such as A/D Oscillator, Moving Average, RSI, CCI, MACD,
Page 4: Forecasting Stock Price Index Using Artificial Neural Networks in the Indonesian … · 2016-05-25 · technical indicators, such as A/D Oscillator, Moving Average, RSI, CCI, MACD,
Page 5: Forecasting Stock Price Index Using Artificial Neural Networks in the Indonesian … · 2016-05-25 · technical indicators, such as A/D Oscillator, Moving Average, RSI, CCI, MACD,

ii

INTISARI

Indeks harga saham adalah faktor yang signifikan mempengaruhi awal pada

pengambilan keputusan keuangan investor. Itu sebabnya memprediksi gerakan

yang tepat dari indeks harga saham jauh dianggap. Penelitian ini bertujuan untuk

mengevaluasi efektivitas penggunaan indikator teknis, seperti A / D Oscillator,

Moving Average, RSI, CCI, MACD, dll dalam memprediksi pergerakan Bursa

Efek Indeks Harga Indonesia (BEI). Sebuah jaringan syaraf tiruan digunakan

untuk peramalan indeks harga saham. Data yang ada dicapai dari Yahoo.Finance.

Untuk menangkap hubungan antara indikator teknis dan tingkat indeks di pasar

untuk periode diselidiki, jaringan saraf propagasi kembali digunakan. Kinerja

statistik dan keuangan dari teknik ini dievaluasi dan hasil empiris menunjukkan

bahwa jaringan syaraf tiruan adalah alat yang cukup baik untuk memprediksi

pasar keuangan.

Kata kunci: Peramalan, prediksi, indeks harga saham, indikator teknis, jaringan

syaraf tiruan

pengambilan keputusan keuauangngan investor. IItutu sebabnya memprediksi gerakan

yang tepat dari indeeksks harga saham jauh dianggap. Penenelil tian ini bertujuan untuk

mengevaluaasisi efektivitas pengggununaaaan n inindidikakatoor r teknis, sepertii A A / D Oscillator,

Movingng Average, RSRSI,I, CCCCI, MACD, dll dalal m memempmprediksi pergererakan Bursa

Effeek Indekekss HaHarrga Inndodonesiak (BEI). Sebuah jariningagan syyararafaf ttiri uan diigug nakan

untuk k peperarammalann indeks harga saham. Data yang ada dicapaiai darii YaYahohoo.o Finanance.

UnUntut kk menanangkap hubungan antara indikator teknis dan tingkaatt indeeksks di pasaar

ununtutuk peperiode diselidiki, jaringan saraf propagasi kembali digunanakann.. KiKinnerja

statistikk dan keuangan dari teknik ini dievaluasi dan hasil empiris mmenunjukkakann

bahwaa jaringan syaraf tiruan adalah alat yang cukup baik untuk mmempreeddikssi

pasarr kkeuangganan.

KaKatata kkunci: Peramalan, prediksi, indeks harga saham, indikator teknknisis, jajarringngan

sysyararafa tiruan

Page 6: Forecasting Stock Price Index Using Artificial Neural Networks in the Indonesian … · 2016-05-25 · technical indicators, such as A/D Oscillator, Moving Average, RSI, CCI, MACD,

iii

ABSTRACT

Stock price index is the initial significant factor influencing on investors' financial

decision making. That's why predicting the exact movements of stock price index

is considerably regarded. This study aims at evaluating the effectiveness of using

technical indicators, such as A/D Oscillator, Moving Average, RSI, CCI, MACD,

etc. in predicting movements of Indonesian Stock Exchange Price Index (IDX).

An artificial neural network is employed for stock price index forecasting. The

existing data are achieved from Yahoo.Finance. To capture the relationship

between the technical indicators and the levels of the index in the market for the

period under investigation, a back propagation neural network is used. The

statistical and financial performance of this technique is evaluated and empirical

results revealed that artificial neural networks are fairly good tools for financial

market predicting.

Keywords: Forecasting, prediction, stock price index, technical indicators,

artificial neural networks (ANN)

Stock price index is the initialal ssigignificant ffacctotor r influencing on investors' financial

decision making. TThahat's why predicting the exact movemements of stock price index

is considerablbly regarded. This sstut dydy aimims s atat evavaluating the effefectc iveness of using

technicacal indicators, susuchch aas A/D Oscillator, MoM vivingng AAvverage, RSI, CCCI, MACD,

ettcc. in prededicictitingng movemements of Indonesian Stockck EExchangnge PrPricice Indexx (IDX).

An artrtifificiciaial neeuural network is employed for stock price iindndex fororececasastit ng. ThT e

exxisistiting datata are achieved from Yahoo.Finance. To capture the rrelelata ionshiipp

bebetwtween n the technical indicators and the levels of the index in the mmarkketet fforor the

period under investigation, a back propagation neural network iss usedd. TThehe

statistiical and financial performance of this technique is evaluated annd emppiiricaal

resultltss revealed that arartitifificicialal nneural networksks aarere ffaiairlrly y good tools ffoor financicialal

mam rket predicting.

KeKeywywords: FForecaaststiningg, predidictctioion,n, sstotockck price iindndexe , tte hch inical inindidicacators,

artifificicialal neural l nenettworks (ANN)

Page 7: Forecasting Stock Price Index Using Artificial Neural Networks in the Indonesian … · 2016-05-25 · technical indicators, such as A/D Oscillator, Moving Average, RSI, CCI, MACD,

iv

ACKNOWLEDGEMENTS

I would like to express my sincere thanks and appreciation to my supervisor,

Professor Dr. J. Sukmawati Sukamulja, for her valuable advice, guidance and very

kind support from the beginning of my study at Faculty of Master of Management

until my graduation.

My gratitude to Drs. Felix Wisnu Isdaryadi, MBA for his sincere comments for

the final edition of this thesis.

I would like to express myy ssininccere thanknkss ana d appreciation to my supervisor,

Professor Dr. J. Sukkmmawati Sukamulja, for her valuablele aadvice, guidance and very

kind supportt ffrom the beginning g ofof mmy y ststududy y att Faculty of Maststere of Management tt

until mymy graduation.

MMy gratititutudede tto Drs.s. FFelix Wisnu Isdaryadi, MBA foforr his sincncereree commenents for

the fifinanal l ede itioonn of this thesis.

Page 8: Forecasting Stock Price Index Using Artificial Neural Networks in the Indonesian … · 2016-05-25 · technical indicators, such as A/D Oscillator, Moving Average, RSI, CCI, MACD,

v

Table of Contents

DECLARATION ......................................................................................................... i

INTISARI ...................................................................................................................ii

ABSTRACT ..............................................................................................................iii

ACKNOWLEDGEMENTS ....................................................................................... iv

List of Tables ............................................................................................................vii

List of Figures ..........................................................................................................viii

ABBREVATIONS .................................................................................................... ix

CHAPTER 1 INTRODUCTION ................................................................................ 1

1.1. Problem Identification ......................................................................................... 5

1.2. Objective of the Research ................................................................................... 6

1.4. Scope of the Research ......................................................................................... 8

1.5. Organization of the Thesis .................................................................................. 9

CHAPTER 2 LITERATURE REVIEW ................................................................... 10

2.1 Artificial Neural Network ................................................................................. 10

2.2 Review of previous researches .......................................................................... 11

2.3 Learning Paradigms in ANNs ........................................................................... 14

CHAPTER 3 RESEARCH METHODOLOGY ...................................................... 20

3.1 Statistical Performance Evaluation of the Model.............................................. 22

DECLARATION ..........................................................................................................

INTISARI .............................................................................. .....................................

ABSTRAACCT ....................................................... ..... ..... .............................................................

ACCKKNOWLELEDGD EMMENTSS................................... .............................................................

Listt of f TaTablbles ...................................................................................................................

LiListst oof f Figugures ...............................................................................................................v

ABABBRREEVATIONS .....................................................................................................

CHAAPTER 1 INTRODUCTION ................................................................................

1.1 1. PrP oblem Identification ........................................................................................

1.2. Objective off the Researchh ..........................................................................................

1.1 4.4. Scope of the Research ............................................................................................

1.1.5.5 Orga inizatition oof f ththee Thesis ..............................................................................................

CHAPAPTETERR 22 LILITERATURE REVEVIEW ...................................................................

2.1 Artificial Neural Network ...................................................................................

2.2 Review of previous researchehes ...........................................................................

2.3 Learning Paradigms in ANNs ............................................................................

Page 9: Forecasting Stock Price Index Using Artificial Neural Networks in the Indonesian … · 2016-05-25 · technical indicators, such as A/D Oscillator, Moving Average, RSI, CCI, MACD,

vi

3.2 Financial Performance Evaluation of the Model .............................................. 24

3.3 Research Data................................................................................................... 25

3.4 Data preparation ............................................................................................... 26

3.5 Variable Calculation......................................................................................... 27

CHAPTER 4 DESCRIPTIVE STATISTICS .......................................................... 31

CHAPTER 5 RESEARCH RESULTS AND ANALYSIS ..................................... 36

5.1 Comparison of Financial Performance.............................................................. 36

5.2 Comparison of Statistical Performance ............................................................. 45

CHAPTER 6 CONCLUSION .................................................................................. 49

REFERENCES ......................................................................................................... 54

Apendix A: Matlab code........................................................................................... 58

A. Preprocess code ................................................................................................... 58

B. Training code ....................................................................................................... 60

C. Testing code......................................................................................................... 73

3.4 Data preparation ..................................................................................................

3.5 Variablee CCalculation..........................................................................................

CHAPPTTER 4 DESSCRCRIPIPTTIVE SSTATATITISTSTICCSS ...... ................................................................

CHCHAPTEER R 55 RRESEARCRCHH RESULTS AND ANNALALYSIS ...........................................

5.1 CComomparisoson of Financial Performance.....................................................................

5.5.22 Commparison of Statistical Performance ....................................................... ............

CHC APPTER 6 CONCLUSION ..................................................................................... .

REFEERENCES ............................................................................................................

ApApenendix A: Matlab code................................................................................................

A. Preprocess code ..........................................................................................................

B.B TrTraiaininingng code ................................................................................................................

C.C. TTesesting codode.e............................ ........................................ ................. ......................................

Page 10: Forecasting Stock Price Index Using Artificial Neural Networks in the Indonesian … · 2016-05-25 · technical indicators, such as A/D Oscillator, Moving Average, RSI, CCI, MACD,

vii

List of Tables

Table 1. The number of sample in the entire data set ............................................... 26

Table 2. Selected technical indicators and their formulas ........................................ 28

Table 3. Defined Variables ....................................................................................... 30

Table 4. ANN parameter levels tested in parameter setting ..................................... 32

Table 5. Summary statistics for the selected indicators ............................................ 33

Table 6. Three parameters for training and testing of ANN model .......................... 37

Table 7: Testing with parameter combination (10, 0.2 , 0.5, 1e6) ............................ 38

Table 8. Testing with parameter combination (30, 0.3, 0.5, 1e6) ............................. 39

Table: 9. Testing with parameter combination (50, 0.2, 0.5, 1e-6) .......................... 39

Table 10. Summary of the best forecasting, parameters (10, 0.2 , 0.5, 1e6) ............ 41

Table 11. Financial performance of ANN model ..................................................... 42

Table 12. The empirical result of other research ...................................................... 44

Table: 13 the best statistic & financial performance ............................................... 46

Table 14. Statistical performance of ANN model .................................................... 48

Table 1. The number off ssaample in the entire datata sset ...............................................

Table 2. Selecctetedd technical indid cators and their formulas ..........................................

Table 3.3. Defined VVarariaiablblese ....................................................................................................

TaTable 4. AANNNN pparametterer llevels tested in parameteterr setting ............................................

Tablble e 5.5 SSummmary statistics for the selected indicators ...................................................

TaTablb e 6. TThree parameters for training and testing of ANN modeell ..................................

TaT ble 77: Testing with parameter combination (10, 0.2 , 0.5, 1e6) ............................... .

Tablee 8. Testing with parameter combination (30, 0.3, 0.5, 1e6) ................................

TaTablb ee: 9. Testing with pparameter combination ((50,, 0.2, 0.5, 1e-6) ......................... ......

Table 10. Summary of the best forerecac ststining, parameters (10, 0.2 , 0.5, 1e6) ................

TaTablble e 1111. Financial pep rformance of ANN model ..............................................................

TaTablblee 12. The emempipi iricaall reresusultlt of ototheher r rresearrchch ......... .....................................................

Table: 13 the best statistic & finanancial peerfr ormance ...............................................

Table 14. Statistical performancce of ANN mmodel ....................................................

Page 11: Forecasting Stock Price Index Using Artificial Neural Networks in the Indonesian … · 2016-05-25 · technical indicators, such as A/D Oscillator, Moving Average, RSI, CCI, MACD,

viii

List of Figures

Fig. 1 An artificial neural network is an interconnected group of nodes................. 11

Fig. 2 A Neural network with three-layer feed forward .......................................... 16

Fig. 3 Tan-Sigmoid Transfer Function and Linear Transfer Function ................. 31

Fig. 4 Data preparation (actual technical parameters & normalized technical

parameters) ...................................................................................................... 34

Fig. 5 Training process of ANN model ................................................................... 34

Fig. 6 Testing of ANN model .................................................................................. 35

Fig.7 Predict next trading day, by entering new data to the network ...................... 35

Fig. 8 Training & Forecasting performance (%) of ANN model for a whole data

set (n = 50, η = 0.2, μ = 0.5, ep = 1e6). .......................................................... 41

Fig. 9 Forecasting performance (%) of ANN model for various η values .............. 43

Fig. 1 An artificial neurralal network is an interconnnnected group of nodes.................

Fig. 2 A Neurarall network withh three-layer feed forward ............................................

Fig. 3 TTan-Sigmoidid TTrarannsfer FuFuncnctitionon andnd LiLinenearar TTrar nsfer Funcctition .................

FiFig. 4 Datataa prprepeparation n (a(actual technical parameetetersr & norrmamalilizezed techninical

papararammeteersrs) ...........................................................................................................

FiFigg. 55 Traraining process of ANN model .......................................................................

FiFig. 6 Testing of ANN model .......................................................................................

Fig.77 Predict next trading day, by entering new data to the network ........................

FiFig.g 88 Training & Forecasting performance (%) of ANN model for a wwhoolele datta a

set (n = 5050, η = 00.22, μ == 00.5.5,, ep = 11e6e6)). ..............................................................

FiFig.g. 9 Forecasting performance (%) of ANN model for various η valueses .................

Page 12: Forecasting Stock Price Index Using Artificial Neural Networks in the Indonesian … · 2016-05-25 · technical indicators, such as A/D Oscillator, Moving Average, RSI, CCI, MACD,

ix

ABBREVATIONS

GDP : gross domestic product

IA : artificial intelligent

ANN : artificial neural network

IDX : Indonesian Stock Index

JKSE : Jakarta Stock Exchange (Pervious name of IDX)

MAE : mean absolute error

RMSE : root mean square error

MAPE : mean absolute percentage error

R2 : goodness of fit

APE : absolute percentage error

PO : predicted output

AO : actual output

CCI : commodity channel index

MACD: moving average convergence divergence

ROC : price-rate-of change

RSI : relative strength index

GDP : gross domestic prodducuctt

IA : artificiaall iintelligent

ANN :: artificial neuru alal nneetworkk

IDDX : Inndodonenesisian Stotockck Index

JKSEE : JJakarartta Stock Exchange (Pervious name of IDX)

MAMAE E : mmean absolute error

RMSEE : root mean square error

MAMAPEE : mean absolute percentage error

R2 : goodness of fit

APAPEE : ababsosolulutete pperercecentntagagee ererror r

POO :: ppreredidictcteded ooututpput

AO : actual output

CCI : commodity channel indexx

MACD: moving average convergencee ddivergence

Page 13: Forecasting Stock Price Index Using Artificial Neural Networks in the Indonesian … · 2016-05-25 · technical indicators, such as A/D Oscillator, Moving Average, RSI, CCI, MACD,

x

PR : predicted rate (forecasting rate)

n : neuron

η : learning rate

μ : momentum constant

ep : epoch

IT : information technology

LSM : The Libyan Exchange Stock Market

TEPIX : The Tehran Exchange Price Index

η : learning rate

μ : momentum coconstant

ep : epochh

IT : iinformationn ttecechnhnology y

LSMM : The LiLibybyan Exchangngee StStockk Ma krk tet

TTEPIX :: TThe e TeT hranan Exchange Price Index