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.References1. Financial Stock Market Forecast using Data Mining Techniques K. Senthamarai Kannan, P. Sailapathi Sekar, M.Mohamed Sathik and P. Arumugam, IMECS 20102. 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



Leave a Comment