/signal_tools

Gem to create MACD, fast stochastic, slow stochastic, and moving average signal tools for a given stock.

Primary LanguageRubyMIT LicenseMIT

Signal Tools

Signal tools allows you to create technical analysis data for a given stock (like MACD, stochastic, and exponential moving averages).

Installation

gem install signal_tools
bundle install --without development test

Usage

require 'signal_tools'

stock = SignalTools::Stock.new('GOOG', '2010-01-01', '2010-05-31')
# Leave the last parameter blank to get from a previous date up until today:
stock = SignalTools::Stock.new('GOOG', '2010-01-01')
# Leave both dates blank to get the past 90 days:
stock = SignalTools::Stock.new('GOOG')

# Generate MACD signal with an 8 day short period, 17 day long period, and 9 day EMA signal period:
stock.macd(8, 17, 9)

# Generate slow stochastic signal with a 14 day K period and a 5 day D period:
stock.slow_stochastic(14, 5)

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history.

  • Send me a pull request. Bonus points for topic branches.

Copyright © 2010 Matt White.