Calculating Indicators for Stock Data Forecasting

In the previous posts was shown how to download stock data into Google spreadsheet using perl script. Here we will look how to add other data indicators based on downloaded stock data prices and volume. The use for stock data prediction of such indicators based on stock data that is usually is available for downloading can be viewed in data mining papers [1], [2] More links and some notes can be found at input-for-stock-data-prediction. Here is the link to stock data analysis perl module with the source code to calculate simple moving average, force index indicator, momentum and some other. In the near future will be added calculations for other indicators.

And here an example how the functions from this module can be used in any perl program:

use warnings;
use stock_data_analysis;
for($i=0; $i<10; $i++) { $data[$i]=$i; $vol[$i]=2; } for($i=0; $i<10; $i++) { print $data[$i]; print "\n"; } @diff_data= stock_data_analysis::do_diff(@data); for($i=0; $i<10; $i++) { print $diff_data[$i]; print "\n"; } print “\n”; print “mean=”; print stock_data_analysis::get_mean(@data); print “\n\n”; @a=stock_data_analysis::sma(4, @data); for($i=0; $i<10; $i++) { print $a[$i]; print "\n"; } print “\n\n”; @a=stock_data_analysis::get_FI(1, \@data, \@vol); for($i=0; $i<10; $i++) { print $a[$i]; print "\n"; } Thus now we can add above indicators to downloaded stock price data in Google spreadsheet. References 1. Financial Stock Market Forecast using Data Mining Techniques K. Senthamarai Kannan, P. Sailapathi Sekar, M.Mohamed Sathik and P. Arumugam, IMECS 2010 2. The Comparison of Methods Artificial Neural Network with Linear Regression Using Specific Variables for Prediction Stock Price in Tehran Stock Exchange, Reza Gharoie Ahangar, Mahmood Yahyazadehfar, Hassan Pournaghshband, (IJCSIS) International Journal of Computer Science and Information Security, Vol. 7, No. 2, February 2010



Calculating Indicators for Stock Data Forecasting

In the previous posts was shown how to download stock data into Google spreadsheet using perl script. Here we will look how to add other data indicators based on downloaded stock data prices and volume. The use for stock data prediction of such indicators based on stock data that is usually is available for downloading can be viewed in data mining papers [1], [2] More links and some notes can be found at input-for-stock-data-prediction. Here is the link to stock data analysis perl module with the source code to calculate simple moving average, force index indicator, momentum and some other. In the near future will be added calculations for many others indicators. And here an example how the functions from this module can be used in any perl program: use warnings; use stock_data_analysis; for($i=0; $i<10; $i++) { $data[$i]=$i; $vol[$i]=2; } for($i=0; $i<10; $i++) { print $data[$i]; print "\n"; } @diff_data= stock_data_analysis::do_diff(@data); for($i=0; $i<10; $i++) { print $diff_data[$i]; print "\n"; } print "\n"; print "mean="; print stock_data_analysis::get_mean(@data); print "\n\n"; @a=stock_data_analysis::sma(4, @data); for($i=0; $i<10; $i++) { print $a[$i]; print "\n"; } print "\n\n"; @a=stock_data_analysis::get_FI(1, \@data, \@vol); for($i=0; $i<10; $i++) { print $a[$i]; print "\n"; } Thus now we can add above indicators to downloaded stock price data in Google spreadsheet. References 1. Financial Stock Market Forecast using Data Mining Techniques K. Senthamarai Kannan, P. Sailapathi Sekar, M.Mohamed Sathik and P. Arumugam, IMECS 2010 2. The Comparison of Methods Artificial Neural Network with Linear Regression Using Specific Variables for Prediction Stock Price in Tehran Stock Exchange, Reza Gharoie Ahangar, Mahmood Yahyazadehfar, Hassan Pournaghshband, (IJCSIS) International Journal of Computer Science and Information Security, Vol. 7, No. 2, February 2010



Input for Stock Data Prediction Algorithms

What can be used for input to stock data prediction system? In this post we will consider some indicator that often are used for stock data forecasting. The links to information about indicators and how to calculate will be also provided.

Moving averages are often used in technical analysis. A few examples: Simple Moving Average (SMA) – to calculate SMA for period of n days we take sum of prices for the n days going back and divide by n. Then move to next day and do it again.

Exponential Moving Average (EMA) – with this moving average the recent data are getting more weight than other. With SMA all data points are getting the same weight.

Here is the indicator that uses prices and volume: Force Index. In two words it is showing how strong is the current trend, how likely it will continue or change.[1] Force index for 1 period can be calculated as

Force Index(1) = (Close_Price (current) – Close_Price (prev)) x Volume

The list of indicators with the information how they are calculated can be found at [2]. They are divided in 3 groups, price based, volume based and breadth indicators. Breadth indicators are based on statistics derived from the broad market. Some papers on stock data forecasting also describe very well the list of variables that were chosen for input.

If we look we can find that there are many different choices but it can improve the quality of forecast accuracy.[3],[4] Not only price , volume or other market statistics can be used for stock market forecasting. Textual web data can be also used but it requires web/text mining processing. You can find some example at [5]

References

1.How to Use Force Index
2.Technical analysis From Wikipedia, the free encyclopedia
3. The Comparison of Methods Artificial Neural Network with Linear Regression Using Specific Variables for Prediction Stock Price in Tehran Stock Exchange Reza Gharoie Ahangar,Mahmood Yahyazadehfar,Hassan Pournaghshband (IJCSIS) International Journal of Computer Science and Information Security, Vol. 7, No. 2, February 2010
4.Financial Stock Market Forecast using Data Mining Techniques K. Senthamarai Kannan, P. Sailapathi Sekar, M.Mohamed Sathik and P. Arumugam, IMECS 2010, hong Kong
5.Daily Stock Market Forecast from Textual Web Data B. Wuthrich, V. Cho, S. Leung, D. Permunetilleke, K. Sankaran, J. Zhang, W. Lam, The Hong Kong University of Science and Technology
6. Technical Indicators and Overlays From StockCharts.com – ChartSchool 7.Financial Stock Market Forecast using Data Mining Techniques K. Senthamarai Kannan, P. Sailapathi Sekar, M.Mohamed Sathik and P. Arumugam



Swing Stock Trading

Swing stock trading means buying and selling stocks many times when the stock prices are at or near their bottom or top position. Some details and more information can be found at [1],[2].

The simple and well known rule – buy low and sell high can be applied here too. But how do we detect when it is low and when it is high?

Historical data and computer simulation can be the answer. We can pick the strategy and then evaluate it using past data. By changing some parameters and running simulation on the past data we can also improve the strategy.

For example the simple rule – buy when one day stock price decrease is more than some number (delta) and sell when the increase is more than delta can be run on previous stock data with the different delta.

References – External Links

1. Swing trading From Wikipedia, the free encyclopedia
2.Swing Stock Trading – Simple Time And Price Predictions Strategy



Some Thoughts on Tag Cloud Generators

In preparation for upgrading the cloud computing tool at Tag Cloud Generator and Service I decided to review tag cloud resources on the web to understand current state and features used.

Below will be brief summary of what was found. First of all here is very useful link to 5 Online Tools To Create Tag Clouds And here is one more review of Word Cloud Generators on the web 12 Cool Word Cloud Generators Some description of tag cloud algorithm and PHP source code can be found at Font variation in tag clouds The usage of tag cloud is now more extended. Many online tag generators now have also text box where any text can be submitted. This allow to use the service for idea brainstorming, text visualization, text analysis.

Originally tag clouds were used as another way of navigation on web site. I still sometimes see the web sites that provide tag cloud widgets however from the reading forum discussion at Tag Clouds: A Worthless WordPress Widget? looks like the usage for website navigation is significantly decreased. However in my opinion this does not mean that such visualization of information is worthless for web site navigation. The problem is that it is very hard to create good tag cloud. The current generators do not have all needed features and so people find tag clouds not usable enough. For example I just saw the tag cloud for “Cloud Computing” and the words “Cloud” and “Computing” where at separated positions. Such separated words can lead to wrong conclusions about links. Additionally I saw some noise words that does not mean much. Such features as remove some words from tag cloud based on different criteria, recognizing word phrases, similar words, grouping near each other tags on the same or similar topic instead of locating tags by alphabet order – all this is very important but still hard to find on the web.

In 2006 in the article The Future of Tag Clouds the author is saying about the idea of being able to manipulate the content and the presentation of a tag cloud. Does anyone know such tools?