Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stocks technical indicator library for Ruby [closed]

I am looking for a "stocks indicator library" written in ruby. A technical indicator could be anything from moving average to Williams %R.

Preferably I need a library where I can provide the historical data for a stock (input) and get the latest value for any technical indicators as output.

Also I am interested in any similar open source libraries written in any other language.

I did some googling and I searched here but no luck so far.

Thanks.

like image 480
Reza Avatar asked Nov 04 '22 08:11

Reza


2 Answers

There is a TA-Lib Ruby gem that wraps the already well-developed technical analysis C++ library http://ta-lib.org/

Having said that, installation of all the components on Ubuntu has been anything but pain-free or lack working native packages (there is a 3rd party Debian repo, but ymmv).

Quantlib in R seems to be the open-source way to go. In fact it prompted me to learn how to embed certain R operations within Ruby, until I'm ready to let go of the crutches and code entirely in R.

like image 179
Marcos Avatar answered Nov 09 '22 15:11

Marcos


For whatever reason, the Python community is much more into number-crunching than the Ruby community is, see this for info about what kind of support Python has: Financial technical analysis in python

If you don't mind rolling some of your own calculations though, ruby is a fine choice.

Check out a ruby project I wrote which updates a csv spreadsheet with new daily values, and computes some moving averages. It is used to generate this page on a daily basis: https://sites.google.com/site/sandp500daily/fri-sep-21-2012-snp-500

Code is here: https://github.com/rschultheis/DailyDoseBlogGenerator

like image 40
SporkInventor Avatar answered Nov 09 '22 17:11

SporkInventor