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
INTISARI Indeks harga saham adalah faktor yang signifikan mempengaruhi awal pada pengambilan keputusan keuangan keua uang ngan investor. Itu Itu sebabnya memprediksi gerakan yang tepat dari indeks indeeks harga saham jauh dianggap. Penelitian Pene neli l tian ini bertujuan untuk mengevaluasi penggunaan indikator mengevaluaasi efektivitas pengg gun unaa aann in indi dika kato or teknis, sepertii A / D Oscillator, Moving ng Average, RSI, RSI, CCI, CCI, MACD, dll dalam dala l m memprediksi memp me mprediksi pergerakan perger erakan Bursa Efek Indeks Harga jaringan syaraf digunakan Effek Indek ekss Ha Har rga Indonesia In ndo donesia (BEI). Sebuah jarin inga gan sy yar araf af ttiruan i uan di ir igu g nakan untukk peramalan Yahoo.Finance. pera pe ram malan n indeks harga saham. Data yang ada dicapai ai darii Ya Yaho hoo. o Finan ance. Untuk tingkat indeks Untu Un t k menangkap mena nangkap hubungan antara indikator teknis dan tingka at inde eks di pasar pasaar untuk digunakan. Kinerja untu un tuk periode pe diselidiki, jaringan saraf propagasi kembali diguna nakann. Ki Kin nerja statistikk dan keuangan dari teknik ini dievaluasi dan hasil empiris m menunjukkan enunjukka kann bahwaa jaringan syaraf tiruan adalah alat yang cukup baik untuk m memprediksi empreedikssi pasarr
kkeuangan. euanggan an.
Kata kunci: teknis, jaringan Kata k unci: Peramalan, prediksi, indeks harga saham, indikator tekn knis is, ja jar ring ngan syaraf syar sy araf a tiruan
ii
ABSTRACT
Stock price index is the initial al significant sig ignificant factor faccto torr influencing on investors' financial decision making. That's movements Tha hat's why predicting the exact movem ements of stock price index is considerably aims considerabl bly regarded. This sstudy t dy aim tu imss at evaluating eva valuating the effectiveness effe fect c iveness of using technical Moving Average, CCI, technica cal indicators, such such as as A/D Oscillator, Mo M ving vi ng A verage, RSI, C CI, MACD, etc. predicting movements Price ettc. in pred edic icti ting ng movem ements of Indonesian Stock ck Exchange Exchang nge Pr Pric ice Indexx (IDX). An artificial neural forecasting. Thee art rtif ific icia ial ne eural network is employed for stock price iindex ndex for nd orec ecas asti t ng. Th T existing ex xis isti ting data dat ata are achieved from Yahoo.Finance. To capture the rrelationship elat el a ionshiip between market betw be tween n the technical indicators and the levels of the index in the m ark ket ffor or the period under investigation, a back propagation neural network iss used. usedd. The The statistical and empirical statistiical and financial performance of this technique is evaluated an nd emp piricaal results artificial result ltss revealed that ar arti tifi fici cial al neural neural networks ks aare re ffairly airl ai rlyy good tools for for financial financi cial al market m rket predicting. ma
Keywords: Forecasting, indicators, Keyw Ke ywords: F orecaast stin ing g, prediction, predi dict ctio ion, n, stock sto tock ck price iindex, ndex nd e , ttechnical ech hnical i indi in dica cators, artificial networks artifi fici cial al neurall ne net tworks (ANN)
iii
ACKNOWLEDGEMENTS
I would like to express my y ssincere inccere thanks in thank nkss and a d appreciation to my supervisor, an Sukmawati Professor Dr. J. Suk kmawati Sukamulja, for her valuable le aadvice, dvice, guidance and very study Master kind supportt from from the beginningg of my my st stud udyy att Faculty of Mast ster e of Management until my graduation. Myy gratitude Felix M grati titu tude de to to Drs. s. F elix Wisnu Isdaryadi, MBA for for his sincere sinc ncer eree comments commen ents for final the fi fina nall ed eedition itio on of this thesis.
iv
Table of Contents
.........................................................................................................i DECLARATION ................ ......................................................................................... INTISARI ...................................................................................................................ii ................................................................................................................... ABSTRACT ABSTRA ACT ..............................................................................................................iii ............................................................................................................................. ACKNOWLEDGEMENTS AC CKNOWLE LEDG D EM MENTS S ........................................................................................iv .............................................................................................. ............................................................................................................vii Listt off Tables Tabl Ta bles ... ............................................................................................................... List of List of Figures Figu gures ..........................................................................................................viii ...............................................................................................................v AB ABBR REVATIONS ..................................................................................... ................ ABBREVATIONS ....................................................................................................ix CHA APTER 1 INTRODUCTION ................................................................................ ................................................................................ 1 CHAPTER 11. 1. Problem P oblem Identification.......................................................................... Pr .............. 5 1.1. ......................................................................................... 1.2. Objective off the Researchh .... ..................................................................................... 6 ................................................................................... 11. 4. Scope of the Research ......................................................................................... ............................................................................................ 8 1.4. Organization .................................................................................. 1.5 Orga 1.5. nizati i tion of of the the Thesis ... ........................................................................................... 9 CHAPTER REVIEW CHAP APTE TER R 2 LITERATURE LI REV EVIEW ................................................................... 10 2.1 Artificial Neural Network .................................................................................. ................................................................................. 10 researches .......................................................................... 2.2 Review of previous researche hes ........ ................................................................... 11 ........................................................................... 2.3 Learning Paradigms in ANNs .... ........................................................................ 14 CHAPTER 3 RESEARCH METHODOLOGY ...................................................... 20 3.1 Statistical Performance Evaluation of the Model.............................................. 22
v
3.2 Financial Performance Evaluation of the Model .............................................. 24 3.3 Research Data................................................................................................... 25 3.4 Data preparation ... ............................................................................................... 26 ............................................................................................... Calculation......................................................................................... 3.5 Variablee C alculation.......................................................................................... 27 CHAPTER DESCRIPTIVE CHAP PTER 4 DES SCR CRIP IPT TIVE STATISTICS STA TATI TIST STIC CS .......................................................... ...................................................................... 31 CHAPTE CH ER 5 R ESEARC RCH H RESULTS AND ANALYSIS AN NAL ALYSIS ..................................... .......................................... 36 CHAPTER RESEARCH 5.1 Comparison Com ompariso son of Financial Performance.............................................................. Performance..................................................................... 36 5. Com mparison of Statistical Performance ................................... ................................ 45 5.22 Comparison ............................................................. C AP CH PTER 6 CONCLUSION .................................................................................. ...................................................................................... 49 CHAPTER REFE ERENCES ......................................................................................................... ............................................................................................................ 54 REFERENCES Apen Ap endix A: Matlab code....................................................................... ......................... 58 Apendix code........................................................................................... A. Preprocess code .......................... ............................................................................... 58 ................................................................................................... B Training B. Trai Tr aini ning ng code ............................................................................ .................................... 60 ....................................................................................................... C. Testing Tes esting cod ode. e........................................................................................................................... 73 code.........................................................................................................
vi
List of Tables
Table 1. The number off ssample ample in the entire data ta sset et ............................................... 26 Selected indicators ........................................ Table 2. Selec cte ted d technical indi d cators and their formulas ...... .................................... 28 Table 3. Defined V aria ar iabl bles e ......................... ............ .............................................................. 30 Variables ....................................................................................... Ta 4. A Table NN pparameter arametter llevels evels tested in paramete terr setting ........ .................................... 32 ANN parameter ..................................... Tabl blee 5. 5 S umm mary statistics for the selected indicators .......... ......................................... 33 Table Summary ............................................ Ta Tabl b e 6. T hree parameters for training and testing of ANN mode el ...... ............................ 37 Table Three model .......................... Ta T ble 77:: Testing with parameter combination (10, 0.2 , 0.5, 1e6) ................... ............. 38 Table ............................ Tablee 8. Testing with parameter combination (30, 0.3, 0.5, 1e6) ...................... .......... 39 ............................. Ta Tabl b e: 9. Testing with pparameter arameter combination ((50, 50,, 0.2, 0.5, 1e-6) ...... ........................ 39 Table: .......................... Table 10. Summary of the best fore reca c st stin ing, parameters (10, 0.2 , 0.5, 1e6) ... ............. 41 forecasting, ............ Ta Tabl blee 11 11. Financial pe pperformance rformance of ANN model ........................... ................................... 42 Table ..................................................... Ta Tabl blee 12. The em empi pirica i al re resu sult lt of ot othe herr rresearch esearrch ..... ......................................................... 44 Table empirical result other ...................................................... Table: 13 the best statistic & financial fina nancial performance peerf r ormance ............................................... 46 Table 14. Statistical performanc ce of ANN m odel .................................................... 48 performance model
vii
List of Figures
Fig. 1 An artificial neural neurral network is an interconnected interconn nnected group of nodes................. 11 Fig. 2 A Neura Neural .......................................... rall network with h three-layer feed forward ........ .................................... 16 Tan-Sigmoid id Transfer Tra ran nsfer Fu Func ncti tion on and nd Li Line near ar T r nsfer Func ra cti tion ................. 31 Fig. 3 Tan-Sigmoid Function Linear Transfer Function Fi 4 Dat ataa pr prep eparation n (actual (a technical parameters parameete ters r & nor rma mali lize zed techni nical Fig. Data preparation normalized technical parameters) ...................................................................................................... para pa ram meteers rs) .................................................................. ......................................... 34 Fig. ................................................................... Fig Fi g. 5 Training Tra raining process of ANN model ........................................ ............................... 34 Fig. .................................................................................. Fi 6 Testing of ANN model ............................................................ ........................... 35 Fig.77 Predict next trading day, by entering new data to the network ................ ...................... ........ 35 Fig. Fig 8 Training & Forecasting performance (%) of ANN model for a whole whoole data datta 50, η = 00.2, .2 2, μ = 00.5, .5,, ep = 1e6). .5 1e6 e6)). .................................................. ............ 41 set (n = 50 .......................................................... Fig. 9 Forecasting performance (%) of ANN model for various η values Fig. es ... .............. 43 ..............
viii
ABBREVATIONS
GDP : gross domestic product prod duc uctt IA
artificiaal iintelligent ntelligent : artificial
ANN : artificial neur u al nnetwork etwork k neural ID DX IDX
In ndo done nesi sian Sto tock ck Index : Indonesian Stock
JKSE E : Jakarta Jakar artta Stock Exchange (Pervious name of IDX) MAE : m MAE ean absolute error mean RMSE E : root mean square error MA E : mean absolute percentage error MAPE R2
: goodness of fit
APE APE
abso solu lute te ppercentage erce er cent ntag agee er erro r r : ab absolute error
PO O
pre redi dict cted ed ooutput utp ut put : predicted
AO
: actual output
CCI
x : commodity channel index
MACD: moving average convergencee divergence divergence ROC : price-rate-of change RSI
: relative strength index
ix
PR
: predicted rate (forecasting rate)
n
: neuron
η
: learning rate
μ
constant : momentum co
ep
: epoch h
IT
information n technology tec echn hnologyy : information
LSM M : The Li Liby byan Exchange Exchang ngee St Stockk Ma rkkett Libyan Market T EPIX : The Thee Tehran T hran Te an Exchange Price Index TEPIX
x