A COLLABORATIVE TRADING MODEL BY SUPPORT VECTOR REGRESSION AND TS FUZZY RULE FOR DAILY STOCK TURNING POINTS DETECTION

Size: px
Start display at page:

Download "A COLLABORATIVE TRADING MODEL BY SUPPORT VECTOR REGRESSION AND TS FUZZY RULE FOR DAILY STOCK TURNING POINTS DETECTION"

Transcription

1 A COLLABORATIVE TRADING MODEL BY SUPPORT VECTOR REGRESSION AND TS FUZZY RULE FOR DAILY STOCK TURNING POINTS DETECTION JHENG-LONG WU, PEI-CHANN CHANG, KAI-TING CHANG Department of Informaton Management, Yuan Ze Unversty, Taoyuan, Tawan LI ZHANG Research Center of Machne Learnng and Data Analyss, School of Computer Scenceand Technology, Soochow Unversty, Suzhou , Jangsu, Chna ABSTRACT The daly stock turnng pont detecton problems are nvestgated n ths study. The Support Vector Regresson model has been appled n varous forecastng applcatons and proved to be wth stable performances. In ths research, SVR has been used to predct the tradng sgnal snce t could handle overall nformaton effectvely even under the complex envronment of stock prce varatons. The tradng sgnals from the hstorc database s derved from the applcaton of pecewse lnear representaton of stock prce. Therefore, the temporary bottoms and peaks of stock prce wthn the studed perod are dentfed by PLR. TS fuzzy rules were appled to calculate the dynamc threshold whch ntersects the tradng sgnal and provdes the tradng ponts. The fuzzy rules were traned and obtaned from the tradng sgnals generated by PLR durng the tranng perod. A collaboratve tradng model of SVR and TS fuzzy rule s used to detect the tradng ponts for varous stocks of Tawanese and Amerca under dfferent trend tendences. The expermental results show our system s more proftable and can be mplemented n real tme tradng system. KEY WORDS Support vector regresson, Stock forecastng, turnng pont detecton, TS fuzzy rule. 1. INTRODUCTION One of the mportant ssues for forecastng market trend s to detect a turnng pont when the stock prces go through the up/down cycle. The turnng pont can be appled to make tradng decsons n stock nvestment. In the real world, the turnng pont detecton s very complex snce there are lots of factors affectng the movement of the stock prce. The stock prce varatons are even under a hgh level of nosness nfluence. These factors nclude nterest rates, economc envronment and so on. Owng to the development n Computatonal Intellgence tools, a collaboratve model can be developed to predct or detect the turnng ponts based on these factors and thus makng proftable tradng for nvestors. In recent years many researches consstently acheve returns snce they used forecastng approach n Computatonal Intellgence tools to reduce nvestment rsk under hstorc nformaton of stock market [1][2]. In the fnancal market

2 techncal ndex have been appled to explan the stock prce varaton and even used to detect turnng pont for stock tradng such as Wllam Index or Relatve Strength Index etc. In tradtonal forecastng, fnancal researches usually use mathematc model to predct stock trend or prce, but the stock prce was quckly changed n a very short tme therefore these models cannot mmedate adjusts to these dynamc changes. A pecewse Lnear Representaton too has been appled to decompose a hstorc stock prce data nto a seres of bottom and peak ponts. Neural networks are further appled to learn the hdden knowledge among the turnng ponts and the techncal ndexes. The model has acheved a consstent proft over other tradtonal approaches as reported n [2]. The collaboratve model development n machne learnng has provded new approaches for predcaton such as artfcal neural network, fuzzy system, support vector machne and other artfcal Intellgence. Among these, support vector machne (SVMs) outperform other approaches n more researches machne has shown better performances than others as n applcaton areas such as [1] [2] [3]. The support vector regresson (SVR) s a regresson-based model based on support vector machne that SVR model has hgh toleraton error rate and hgh accuracy n complex problems. The fuzzy system has been consdered as an effcent and effectve n control uncertantes of systems [4], by usng fuzzy rule based system could prove stable sgnal for predctng dynamc tradng threshold n stock market. The man purposes of ths research are: 1) Develop a Collaboratve Tradng Model for Daly Stock Turnng Ponts Detecton: Apply machne learnng approaches that combne support vector regresson and TS fuzzy rule for learnng tradng sgnal and dynamc tradng threshold, respectvely. 2) Provdng nvestor smple tradng dersons: accordng to collaboratve tradng model to generate tradng decsons,.e., buy/sell/hold under daly bass. 2. LITERATURE REVIEW In past years accordng to most studes shows that fnancal tme seres forecastng usually focus on fundamental or techncal analyss. Fundamental analyss could forecast the long term of trade n stock market whch may only trade once a year. Therefore, the techncal analyss s appled to further mprove the long term analyss. Techncal ndces could provde the trade nformaton n short or medum term. Techncal ndces of stock are very common appled n fnancal analyss. An ntellgence stock tradng system [5] s developed accordng to these Techncal ndces and probablstc reasonng to forecast tradng ponts. The conventonal approach to modelng stock market forecastng s usng the unvarate tme seres and they nclude multple regresson, autoregressve (AR), movng average (MA), GARCH and ARIMA [6] models. A strong tradng sgnal detecton method must consder not only stock prce varatons, but also other nformaton that can help nvestor. As ths secton descrbes, these models can help solve the tradng sgnal problem. However, these models requre complex mathematcal formulas whch are not that easy to be understood by the nvestors. Therefore, t seems there should be another way to solve ths problem more effcently. A. Computer-Based Approach for Fnancal Forecastng The stock market forecastng was very complex that explanaton n prevous part, recent years the fnancal tme seres forecastng appear more new

3 approaches whch they are computer-based to learnng knowledge n pattern recognton task. The turnng pont on tme seres data has more approach to found such as Fourer transforms, Wavelets, and pecewse lnear representaton (PLR) method on tme seres database that PLR has been used to support more tasks and t has effcent and effectve solutons [7]. The major functons that usng some of pecewse to represent varous trends. PLR has been appled to stock market for stock prce forecastng, the result shows used PLR could mprove forecast accuracy [8]. Therefore PLR method used to fnd turnng ponts that there are promse hgh proft. B. Support Vector Regresson Machne learnng technques have been appled for assgnng tradng sgnal. Many studes used support vector machne for determnng whether a case contan partcular class [1] [2] [9] [10]. But the shortcomng s only deal wth dscrete class labels, whereas tradng sgnal s contnuum because a weght of sgnal can take a buy or sell power. Grounded n Statstcal Learnng Theory [11], support vector regresson s capable to predctng contnuous tradng sgnal whle stll beneftng from the robustness of SVM. SVM have been successfully employed to solve forecastng problems n many felds, such as fnancal tme seres forecastng [12], emoton computaton [13] and so on. There are stll some sgnfcant parameters ( ) n emprcal results and the value s gven by experment n ths research. SVM apply n fnancal tme seres that t only focused on prce or trend to forecastng that cannot drect to transacton n stock market. Therefore, we buld a sgnal for transacton whch t call tradng sgnal that the value range from zero to one for decson makng. C. Fuzzy Rule-based System Fuzzy systems are from fuzzy theory for varables wth nference have fuzzy logc and fuzzy set, fuzzy control, fuzzy relaton and fuzzy measure [4]. The rule based fuzzy systems are wdely applcaton that usng fuzzy f-then rule descrbed complex problem. The W-M and TS fuzzy are based on fuzzy f-then rule to propose. W-M has been mproved [14] to solve several dfferent problems. The TS fuzzy rule model that uses multple sub lnear system based on fuzzy membershp for solved nonlnear problem n control systems [15]. The TS fuzzy system has extends to used smple lnear approach of regresson for solve complex problem of stock. C,, 3. CTM-A COLLABORATIVE TRADING MODEL BY SUPPORT VECTOR REGRESSION AND TS FUZZY RULE Ths paper attempts to buld a collaboratve tradng model to detect daly turnng ponts for stock tradng. The system of collaboratve tradng model developed from SVR and TS-fuzzy rule approach to learnng overall tradng sgnal knowledge (all tradng sgnal nclude buy-sell and holdng pont) and dynamc tradng threshold knowledge (only buy-sell ponts). CTM goes through fve steps, as shown n Fg. 1. A. Step1: Determnng Turnng pont and Tradng Sgnal Tradtonally, nvestors have studed the varaton n techncal ndces to make ther tradng decson. However, t s not easy for every nvestor to make a good tradng decson by studyng the varaton n techncal ndex. 1) Mnng tradng pont by PLR:

4 In ths paper, we want to use pecewse lnear representaton method to fnd turnng pont wth tme seres data that fnd the low and hgh pont for next learnng model. The steps of PLR are as follows: Frst fnd the ponts of beng (p 1 ) and end (p n ) on a term of closng prces n ascendng order of the dates. Second fnd a pont (p k ) has longest dstance wth the straght lne that between two ponts of prevously found. The k pont s a new turnng pont form two segments of p 1 to p k and p k to p n. Repeated for both segments, recursvely when satsfy the dstance threshold. 2) Tradng sgnals transformaton: Through PLR segmentaton that there have many segments of uptrend and downtrend. A mathematcal formula s used to convert these PLR segments of the stock prce nto tradng sgnal. The pont values of tradng sgnal are followng as Equaton (1) and (2) to converson. Up-trend segment: T 0.5 ( 1) / L / L 0.5 Down-trend segment: T T f L / 2 f L/ ( 1) / L f L / / L f L/ 2 whch, L s the length of the uptrend or downtrend seres; s the data pont n L; s the tradng sgnal. The range of tradng sgnal s zero to one whch f close to turnng ponts ntersects at 0.5. B. Step2: Feature Selecton by Stepwse Regresson Analyss (SRA) Accordng to reference shows f select some of mportant feature could mprove effect before learnng model [16]. Therefore, we want to use stepwse regresson analyss to select features from techncal ndces that these selected features have hgh relatonal feature wth tradng sgnal. C. Step3: Learnng Tradng Sgnal Knowledge by Support Vector Regresson Model Inducton To learn the functon that maps the feature values to the predcted tradng sgnal, we use SVR wth -nsenstve loss functon s used where a errors small than a pre-defned parameter are consdered. We use a nonlnear kernel to learn a nonlnear forecastng model because of the stock complex stock wll be better. The nput vector from techncal ndces after feature selecton and output vector form tradng sgnal by PLR wth transformaton. Tranng Hstorcal Stock Data Testng Daly techncal ndces (1) (2) Stock prce Fnd turnng pont by PLR Techncal ndces Feature selecton by SRA x1,x2...xk Tran fuzzy rule by TSK fuzzy Predct tradng sgnal threshold Predct overall tradng sgnal Intersecton No Turnng pont? Tradng sgnals Y x1,x2... Tran tradng xk model by SVR y on tranng Buy/sell and calculate proft Yes Fg. 1 Framework of collaboratve tradng model

5 D. Step4: Learnng Tradng Sgnal Threshold by TS Fuzzy Rule In ths secton we use TSK fuzzy system to buld fuzzy rule for learn tradng sgnal threshold. The nput vector form predctng value of SVR on tranng that due to SVR predcton may has very small movng we hope the tradng sgnal threshold close to tradng sgnal of SVR. The sub rule lnear regresson that usng least squares method to compute regresson coeffcent as, the f-then rule buldng as Equaton (3)., Rule : f x (k) s M and... and x (k) s M 1 then y β 1 0 1, 2,..., N mj x (k)... β m1 1 n mn x (k) where, k s dscrete tme ndex; x j s j th feature; s a fuzzy term of M j selected for rule ; s coeffcent of selected j th feature for rule. E. Step5: Tradng Decsons makng In the daly forecastng, f the tradng sgnals of SVR ntersect tradng sgnal thresholds. The ntersecton ponts are recommendng to transacton n stock market whch f the tradng sgnal pass through threshold from up to down ths means needed to quck to buy stock because very closeness turnng pont otherwse f the state was bottom to up needed to sell stock. n n M j (3) 4. EXPERIMENTAL RESULTS FOR STOCK FORECASTING We have selected 5 stocks for analyss whch collected from Amercan stock market that data perod of stock prce and techncal ndces collected were from 1/2/2008 (dd/mm/yy) to 6/30/2009, whch uses the perod of 1/2/2009 to 6/30/2008 to form the testng data perod. There have 2 stocks collected from Tawan stock market that the dates of tranng data have from 1/2/2006 to 10/14/2008. The dates of testng data have from 10//15/2008 to 4/9/2009. Due to not have a standard method to calculate the model effect or effcent n stock market when predct the buy-sell sgnal. In ths paper, we calculate the proft how much proft we can capture. The proft s calculated follow as Equaton (4). profts M k S 1 (1 a) (1 a b) C (1 a) C C whch M s the total amount of the money to be nvested at the begnnng, a refers to the tax rate of th transacton, b refers to the handlng charge of th transacton, k s the total number of transacton, s the sellng prce of the th transacton and s the buyng prce of the th transacton. C B B TABLE I compare to rate of proft between two stock trade models Stock PLR-BPN SVR-TS Stock PLR-BPN SVR-TS Apple 61.28% 45.16% XOM 0% 14.78% CAT % 17.01% 2448.TW 44% 35.1% JNJ % 6.31% 2303.TW 74% 38.03% VZ 15.36% -1.24% Accordng to our system forecastng result show that collaboratve tradng sgnal has turnng ponts for acqure stable return. Table I shown as the PLR- BPN model [4] return exst hgh varaton, our model was very small, and the proft standard devaton of PLR-BPN and SVR-TS are 0.38 and 0.17, separately. SVR-TS provded hgh confdence for nvestor to nvestment. B C S (4)

6 5. CONCLUSION In ths paper proposed tradng model of CTM could help nvestor to capture proft was very stablty. Expermental results shown the collaboratve tradng model by support vector regresson and TS fuzzy rule have stable tradng sgnal and dynamc tradng threshold for daly stock turnng pont detecton. However, the prmary goal of the nvestor could be easly acheved by provdng hm wth smple tradng decsons. ACKNOWLEDGEMENT Ths work was supported n part by the Natonal Natural Scence Foundaton of Chna under Grant Nos , and REFERENCES [1] Pe-Chann. Chang; Ch-Yang. Tsa; Chung-Hua. Huang; Chn-Yuan Fan. Applcaton of a Case Base Reasonng Based Support Vector Machne for Fnancal Tme Seres Data Forecastng. The proceedng of ICIC 2009, , PP , South Korea. [2] Pe-Chann. Chang; Chn-Yuan Fan; Chen-Hao. Lu; Integratng a Pecewse Lnear Representaton Method and a Neural Network Model for Stock Tradng Ponts Predcton. IEEE Transactons on Systems, Man, and Cybernetcs, Part C: Applcatons and Revews, vol. 39, no.1, 2009,PP: [3] Alex J. Smola; Bernhard. A Tutoral on Support Vector Regresson. Statstcs and Computng, vol. 14, 2004, PP: [4] L. A. Zadeh. Fuzzy sets. Informaton Control. vol. 8, no. 3, 1965, PP: [5] Depe Bao; Zehong Yang. Intellgent Stock Tradng System by Turnng Pont Confrmng and Probablstc Reasonng. Expert System wth Applcatons, vol. 34, 2008, PP: [6] Allan Tmmermann; Clve W. J. Granger. Effcent Market Hypothess and Forecastng. Internatonal Journal of Forecastng, vol. 20, 2004, PP: [7] Yuelong Zhu; De Wu; Shhn L. A Pecewse Lnear Representaton Method of Tme Seres Based on Feature Pnts. The proceedng of KES 2007/ WIRN 2007, Part II, Vetr sul Mare, Italy, , PP: [8] Huanme Wu; Betty Salzberg; Donghu Zhang. Onlne Event-drven Subsequence Matchng over Fnancal Data Streams. The proceedngs of the 2004 ACM SIGMOD, 2004, PP: [9] Yen-Wen Wang; Pe-Chann Chang; Chn-Yuan Fan; Chung-Hua Huang. Database Classfcaton by Integratng a Case-Based Reasonng and Support Vector Machne for Inducton. Journal of Crcuts, Systems, and Computers, vol. 19, no. 1, 2010, PP: [10] L Zhang; We Da Zhou; Pe-Chann Chang. Generalzed Nonlnear Dscrmnant Snalyss and Its Small Sample Sze Problems. Neurocomputng, vol. 74, no.4, 2011, PP: [11] Vn Vapnk. The Nature of Statstcal Learnng Theory, Sprnger, [12] Ncholas I. Sapankevych; Rav Sankar. Tme Seres Predcton Usng Support Vector Machnes: A Survey. IEEE Computatonal Intellgence Magazne, vol. 4, 2009, PP: [13] Jheng-Long Wu; Shh-Lng Chang; Lang-Chh Yu; Pe-Chann Chang. Usng Inter-Sentental Language Pattern for Causalty Identfcaton from Emoton Texts. The proceedng of ICIMT 2010, Vol. 2, 2010, PP: 57-61, Hong Kong. [14] L-Xn Wang. The WM Method Completed: A Flexble Fuzzy System Approach to Data Mnng. IEEE Transactons on Fuzzy Systems, vol. 11, 2003, PP: [15] Tomohro Takag; Mcho Sugeno. Fuzzy Identfcaton of Systems and Its Applcatons to Modelng and Control. IEEE Transactons on Systems, Man, and Cybernetcs, vol. 14, no. 1, [16] Thomas J. Burkholder; Rchard L. Leber. Stepwse Regresson s an Alternatve to Splnes for Fttng Nosy Data. Journal of Bomechancs, vol. 29, no. 2, 1996, PP: