Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
rupee aims to provide user-friendly tools for use in financial gems and applications.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
ext/rupee
lib
spec
tasks
.autotest
.gitignore
.rspec
COPYING
Gemfile
README.rdoc
Rakefile
rupee.gemspec

README.rdoc

Rupee - financial tools for Ruby

Homepage

www.brymck.com

Author

Bryan McKelvey (bryan.mckelvey@gmail.com)

Copyright

Copyright © 2011 Bryan McKelvey

License

MIT

http://api.flattr.com/button/flattr-badge-large.png

    /|\
   / | \
  /  |  \
 /_ / \ _\    RU       PE      E
|  |   |  |   _ _      _
|  |   |  |  | | |    | |__o  ____
|  |   |  |  | | | _  |  __| |____|
| _|   |_ |  | | |/ / | |___
 \  \ /  /  /_/|___/   \____|
  \  |  /
   \ | /
    \|/ brymck

Installing

Note that you must have Ruby 1.8.7+ installed and the ability to compile native extensions (standard on most platforms and available on Windows via DevKit.

gem install rupee

You can also do things the hard way if you want to keep track of the repo:

git clone git://github.com/brymck/rupee.git
cd rupee
bundle update
rake install

After all that hard work, you can take a test drive by running something like this in the command prompt:

irb
require "rupee"
Rupee::Option.black_scholes "c", 60, 65, 0.25, 0.08, 0, 0.3

which should return `2.1334`.

You should also be able to get the latest stock info for, for example, Wells Fargo using the following (note that you only need to `require` the `quote` module):

irb
require "rupee/quote"
Rupee::Quote.bloomberg "WFC", :price, :change, :pct_change

Got it? Good. This will surely help you collect some rupees in real life.

Performance

This is just a simple benchmark I ran on my own laptop, where I value a simple call option with Black-Scholes one million times. You can test the same on yours with rake, but in any case it makes the point that for the mathematical side of finance a native extension in C/C++ has substantial benefits:

rake benchmark:black_scholes

Results:

                 user     system      total        real
rupee:       1.388000   0.000000   1.388000 (  1.440000)
pure ruby:  18.580000   0.000000  18.580000 ( 18.817000)
Something went wrong with that request. Please try again.