Automated Fundamental Analysis for Stock Ranking and Growth Prediction

Size: px
Start display at page:

Download "Automated Fundamental Analysis for Stock Ranking and Growth Prediction"

Transcription

1 Proceedings of th International Conference on Computer and Information Technology (ICCIT 2009) December, 2009, Dhaka, Bangladesh Automated Fundamental Analysis for Stock Ranking and Growth Prediction Ariful Islam, Hasib Zaman, Reaz Ahmed Department of Computer Science and Engineering Bangladesh University of Engineering and Technology, Dhaka-1000, Bangladesh Abstract In this paper we present the Automated Ranking by Fundamental Analysis (ARFA), a new Fundamental Analysis (FA) tool developed for aiding the research of fundamental indicators. ARFA provides a flexible and easy to use yet powerful platform to create and test new fundamental indicators for analyzing and comparing fundamentals of the companies in a stock market. AR- FAoffers a software interface for FA that is straight forward, easy to learn and at the same time exceptionally expressive without the need of any programming or customization. In this work, we present a detailed description of AR- FAs indicator creation platform with demonstration of its power by showing a number of well-known indicators written in ARFAs terminology. ARFA is intended for researcheras well as share market investors. It is web-based, free and open source. ARFA has a simple programming interface for future extensions of its terminology andability with easily pluggable modules. Keywords: Automated ranking, Data Processor, Dynamic variable, Fundamental Analysis, Fundamental indicator, Parser. I. INTRODUCTION Fundamental analysis (FA) is the cornerstone of investing. FA of a business involves analyzing its financial statements and strength, its management and competitive advantages, and its competitors and markets. FA is performed on historical and present data, but with the goal of making financial forecasts. Fundamental investors look for stocks that are below their intrinsic value. FA is the examination of the underlying forces that affect the well being of the economy, investment sectors, and companies. This involves looking at revenues, expenses, assets, liabilities and other financial aspects of a company to gain insight on the company s future performance. To forecast future stock prices, FA combines economic, industry and company analysis to derive a stocks current fair value and forecast future value. FA has less popularity than Technical Analysis (TA) as many people thinks FA is not suitable for short term investment and suitable analysis tools are not available to investors yet. But the future prospect of a company can only be assesed by its financial fundamentals and the success of an investment depends highly on FA. Without FA an investment may suffer in the long run. There exists research on FA for long time and many mathematical models are derived but computer aided FA is not yet available to the investor. For making FA easy to understand and user friendly we have developed ARFA. The basics of FA are examining some key ratios in business and developing an idea of the value of its stock. ARFA provides an open ground for investor and researcher to evaluate and compare the performance of new concept indicators as well as the existing ones. In order to provide this capability we have designed a recursive expression language in terms of commonly used company fundamental measure. To implement an indicator in ARFA one has to express the indicator in ARFA expression language. ARFA will then output the result both in graphical and tabular format showing relative ranking of the companies. In ARFA, companies filtered by constraints like market sectors, market categories, company types etc. We believe that ARFA will assist the investors to test their ideas and to make profitable business decision. The rest of this paper is organized as follows. Section 2 describes the overall system design. All Functional details and effect of using ARFA is presented in section 3. We have presented some related works in Section 4. Some future improvement and expansion of ARFA is given in Section 5 and finally we conclude in Section 6. II. SYSTEM ANALYSIS AND DESIGN In this section we present the overall system design. Figure 1 presents the use case diagram of the System. Fig.1 Usecase Diagram /09/$ IEEE 145

2 The functionality of these use case are as follows: Input variable - Take variable as an input fromvariable list table.two list is provided, one containing fundamental variables and other historical variables (see section III-B). Generate function - Makes expression using input variables according to ARFA grammar (see section IIIA), output a new function and store it into function table. Apply function - Show the list of available indicators or functions. selecting one, calculate function value from background data. Ranking - Ranks companies or shares according to market catagory, sector, etc. Display company - Show the ranked list to the customer or user of the system. (see example in section III-E) Figure 2 presents the block diagram of System. Function name and its equation is stored in a new table named indicator. Sequence diagram of Figure 4 represents Function creation details. Fig.4 Sequence diagram-function creation The new indicator data is added in instrument table and generates new variable to variable list. Details about indicator creation process is given in section III-C. Screen shot for adding new indicator is shown in Figure 5. Fig.2 Block Diagram ARFA produces the desired outcome representing the effect of a fundamental indicator. Three tables are provided: Performance, Instrument and Quote. Performance and Quote contains historical variable data, Instrument contains fundamental variable data. See details about variable list in section III-B. New variables can also be added in those tables. Sequence diagram of Figure 3 represents variable creation details. Fig.5 UI- Add new indicator. A Parser then parses this expression and identifies the variables to be collected. We use the general equation parsing algorithom to find out the variables. Sequence diagram of how to use existing indicators to rank companies is given in Figure 6. Fig.3 Sequence diagram Variable Creation. User writes an equation by using this variables. Fig.6 sequence diagram- ranking. 146

3 The Data processor subsequently collects the required data from current instrument table or from background tables like quote, performance. Finally, the ranking algorithm process all this information and produces a ranked list (details in section III-D). Output filtering option is also available. An AI-based trading agent can use the data generated from ARFA, in conjunction with technical analysis and news, to produce automated buy or sell decisions. We have used MySQL as database and both the Parser and the Data Processor are written in PHP. III. FUNCTIONAL DESCRIPTION A. Regular Expression Grammar ARFA maintains the following grammar fragment: Function variable operator variable variable operator num variable variable id id [parameter] where the terminals operator, id, num and parameter generate sets of strings given by the following regular definitions: letter [a z A Z] digit [0 9] id letter (letter digit)* digits digit digit* fraction.digits ε num digits fraction operator + - * / sign + - parameter sign* digits B. Variables of System ARFA uses two list of variables, one static and other dynamic. Static variables may be called as fundamental variables contained in instrument table. They have same value for every year. Some fundamental variables are Market Capital, Share Capital, Face value, Market Lot, Num Security, Company Type, Last AGM Date, Reserve Surplus, Market Category etc. Dynamic variables are historical variables contained in performance and Quote table. They have different values for different years. For example, EPS of current year is EPS[0], EPS of previous year EPS[-1], EPS of 2 years before current EPS[-2] etc. Some of historical variables are - EPS, Net Asset, Net Profit, PER, Div Bonus, Div Right, Div Cash, Dividend Yield, Diluted Net Asset, Diluted EPS etc. Quote table contains maximum close price (MaxCP), minimum close price (MinCP) and average close price (AvgCP). C. Creating Various Indicators ARFA gives the facility to create any new indicator. An example is given in Figure 5. A simple indicator of ARFA can be, (var1 + var2 / 2) - (var1 * var3) For Example, Growth1 = (face value * cash div) + (avg price * stock div) + ((avg price - face value)* right share) ARFA provides the facility to create various complex indicators. An indicator equation can have both static and dynamic variables. ARFA joins the current instrument table with available background tables performance, quote etc. A complex indicator of ARFA can be, (var1 + var[-1]) - (var[-1] - var[-2]) * 0.5 For example, function1 = (Share capital Market Capital) / Net Asset[-1] + (EPS[-1] + EPS[0]) / 2 Another way to create complex indicators is to use multilevel indicators. Any output of an indicator in ARFA can be made available for use as an input in another indicator. This way the second indicator uses the output of the first indicator to produce its output. That means, user can reuse his own indicators. The following indicator is possible. function2 = (function1 * 2) + EPS[-2] D. Ranking and Comparing Indicators Performance New indicators can be used for Ranking. When user provides an indicator equation to ARFA, it is saved to instrument table as a new column. Next time, it is added to indicator list. ARFA gets function list from indicator table, one is selected. Filtering option such as market category, sector etc. is provided. ARFA gets company rank from processed data and ranked list is shown as output in both tabular and graphical form. ARFA provides the facility of comparing various indicators performance on the same data. suppose, we want to compare between EPS and NAV. Then a ranked list by EPS and another ranked list by NAV is produced. ARFA measures performance of both and decides which one is better. E. Output Analysis In this section ARFA output analysis is briefly described. Top 10 or Top N list can be produced easily by ARFA. Table I contains some top 10 lists generated by ARFA based on different indicators. 147

4 TABLE I TOP 10 The summery table is shown in Table III. Current EPS NAV Net Prof PER ISLAMIBANK ISLAMIBANK TITASGAS RENATA 1STICB ISLAMIBANK ABBANK SONALIANSH ABBANK 1STICB STYLECRAFT PRIMEBANK DUTCHBANGL MONNOJTX SQURPHARM APEXADELFT RENATA A SQURPHARM SQURPHARM POWERGRID A A NBL PHARMAID DUTCHBANGL SOUTHEASTB IFIC BLTC IFIC AZADIPRIN ABBANK EXIMBANK ISLAMIBANK BEXIMCO BDTHAI ABBANK BLTC ICB BXFISHERY RUPALIBANK PHARMACO LEGACYFOO T BSC EASTRNLUB BEACHHATCH SAVAREFR KAY&QUE QSMDRYCELL HILLPLANT ICB1STNRB GLAXOSMITH UTTARABAN K Current ISLAMIBANK BEXIMCO BDTHAI ABBANK BLTC ICB BXFISHERY RUPALIBANK PHARMACO LEGACYFOOT TABLE II Current TOP 10 Profit Total TABLE III SUMMERY TABLE Indicator Common Profit Difference(%) EPS NAV Net Prof PER Current column is based on percentage of (MaxCP-MinCP)/MaxCP where other columns are based on corresponding indicators. MaxCP means maximum close price and MinCP means minimum close price. Current top 10 company with profit value is given in table II. Common means the number of common companies between current list and indicator based list. Profit column is calculated by the same way of table II. Common means the number of common companies between current list and indicator based list. Profit column is calculated by the same way of table II. Difference = (currentprofit - indicatorprofit) / currentprofit Profit = (MaxCP-MinCP)/MaxCP 148

5 Current profit is found from last row of tableii. Indicator profit is found from Profit column of table III. From table III we can see that, difference between current profit and indicator based profit is smallest for Net Prof and then for EPS. So EPS and Net Profit are better indicator than PER and NAV. Thus we can analysis any indicator s (existed or newly created) performance by ARFA system. IV. RELATED WORK Stock market prediction has always been one of the hottest topics in research, as well as a great challenge due to its complex and volatile nature. However, most of the existing methods neglect the impact from fundamental analysis of stock market. A genetic programming based system is presented in [9] which specializes in taking some well known technical rules and adapting them to prediction problems. An evaluation of the performance of back propagation neural networks applied to the problem of predicting stock market prices can be found in [3]. Kim [7] has presented prediction mechanisms basedon support vector machines. In [2], a framework for a Multi-Agent System for Stock Trading is presented that addresses the issue of gathering and integrating diverse information sources with collaborating agents and providing decision-making for investors in the stock market. [11] presents a system that combines the information from both related news releases and technical indicators to enhance the predictability of the daily stock price trends. In [8] Least Squares Support Vector Machines are used for Stock Market Trend analysis. [6] finds Trading Patterns in Stock Market Data. [1] discussed about wireless investor. [10] discussed Trading With a Stock Heuristic. A Multiagent Approach to Qlearning for Daily Stock Trading is described in [4]. Stock Trading Using RSPOP discussed in [5]. V. FUTURE RESEARCH There exists various research sectors for extending the work presented in this paper. One of the major improvements can be to introduce Technical Analysis Tools like MACD (Moving Average Convergence- Divergence), RSI (Relative Strength Index) etc. as functions besides fundamental functions. Generally technical analysis is most effective in the short-term and less effective in the long-term, and fundamental analysis is effective for long- term investment decisions and less effective in the short-term. If Fundamental Analysis Tools can be joined with Technical Analysis tools, it will be strong enough to perform both analysis and thus give investors and traders flexibility to consider both short-term and longterm VI. CONCLUSION In this paper we presented a completely new tool for FA that help creating and experimenting new FA indicators. This web- based system is very expressive and provides complete support for wide range of indicators based on ratios used in FA. It also provides the framework for adding various indicators and using their out come in real life business decision making. It is in the early stage of development but still it is a powerful tool for Fundamental Analysis. If it is possible to combine FA with technical analysis then investor will highly be benefitted from this. In future we will find that this tool is an important tool both to the researchers and investors in business decision. REFERENCES [1] Peter Blakey. Wireless investor : Fundamental and technical analysis. IEEE Microwave Magazine,DECEMBER [2] K. Liu Davis, D.N. and Y. Luo. A multi-agent framework for stock trading. Technical report, 16th IFIT World Computing Congress, Beijing, China, [3] B. Freisleben. Stock market prediction with back propagation networks. In Industrial and Engineering Applications of Artificial Intelligence and Expert System, pages , Paderborn, Germany, June th International Conference. [4] Member IEEE Jangmin O Jongwoo Lee Jae Won Lee, Jonghun Park and Euyseok Hong. A multiagent approach to q-learning for daily stock trading. IEEE TRANSACTIONS ON SYSTEMS, MAN, AND CYBERNETICSPART A: SYSTEMS AND HUMANS, 37(6), NOVEMBER [5] IEEE Kai Keng Ang, Student Member and IEEE Chai Quek, Member. Stock trading using rspop: A novel rough set-based neuro-fuzzy approach. IEEE TRANSACTIONS ON NEURAL NETWORKS, 17(5), SEPTEMBER [6] Stephen Barrass Keith V. Nesbitt. Finding trading patterns in stock market data. IEEE Computer Graphics and Applications, [7] K. J. Kim. Financial time series forecasting using support vector machines. Technical report, Neurocomputing, [8] Shouyang Wang Lean Yu, Huanhuan Chen and Kin Keung Lai. Evolving least squares support vector machines for stock market trend mining. IEEE 149

6 TRANSACTIONS ON EVOLUTIONARY COMPUTATION, 13(1), FEBRUARY [9] Jin Li and Edward P.K. Tsang. Improving technical analysis predictions: An application of genetic programming. In Proceedings of The 12th International Florida AI Research Society Conference, pages , May [10] Steven Hornik Russell L. Purvis William Leigh, Cheryl J. Frohlich and Tom L. Roberts. Trading with a stock chart heuristic. IEEE TRANSACTIONS ON SYSTEMS, MAN, AND CYBERNETICSPART A: SYSTEMS AND HUMANS, 38(1), JANUARY [11] Arthur Hsu Yuzheng Zhai and Saman K Halgamuge. Combining news and technical indicators in daily stock price trends prediction. Masters thesis, University of Melbourne, Victoria, Australia,