Edgar-Stocks is a Ruby gem that provides access to daily and historical stock data in a simple, configurable way.
Edgar provides the following info for a stock:
- Opening price
- Closing price
- Daily high
- Daily low
- Adjusted close
- Volume
In addition to the above, Edgar can calculate the rolling average for a given date for a particular stock.
Have more ideas how I can improve the gem? Leave me a message!
Add this line to your application's Gemfile:
gem 'edgar-stocks'
And then execute:
$ bundle
Or install it yourself as:
$ gem install 'edgar-stocks'
Require the Edgar library and simply create a new Edgar object for each stock you care about:
require 'edgar'
stock = Edgar::Edgar.new('INTU')
Then query it!
stock.closing_price # Returns today's closing price
Or ask for a date in the past.
stock.closing_price(DateTime.yesterday) # Obviously get yesterday's closing price
You can even get running averages
stock.closing_price(DateTime.now, 5) # Get the five day average closing price starting with today's closing.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request