Rupee is a Ruby gem that I've written for financial functions. It allows you to price options and pull a great deal of information on securities from online sources, all organized around Ruby's object-oriented model.
Also, due to the speed considerations when dealing with models, the more mathematical parts of the extension are written in C for maximum efficiency. Thus, you can create a call option like so:
bs_call = Rupee::Call.new(
:underlying => 60,
:strike => 65,
:time => 0.25,
:rate => 0.08,
:div_yield => 0.00,
:volatility => 0.3
and you can retrieve its Black-Scholes valuation using
Or, you can skip to the chase if you don't need to hold onto something as an object (e.g. with Monte Carlo sims) and just go with:
Rupee::Option.black_scholes "c", 60, 65, 0.25, 0.08, 0, 0.3
The rest of the extension is organized on similar lines for various options and fixed-income securities.
If you already have Ruby installed, you can run the following in a command prompt to install it:
Get live quotes and charts for stocks and securities of your choice from Bloomberg, Google, Yahoo! and Quote.com at the click of a button!
This extension pulls quotes from Bloomberg, Google Finance and Yahoo! Finance. All of these services have their strengths and weaknesses with market coverage, charting tools and personal portfolios, so why choose between them? The quotes you've chosen update automatically, and clicking on one will open its price history chart in the same window.
To add your own ticker symbols, just visit the options page (accessible via both the right-click menu and the popup window). Instructions are there, although it mostly just involves you typing a ticker symbol and selecting the quote service you wish to use. You can also edit which metrics you want to see in the columns displayed, as well as the update frequency.
As of version 1.3, I've added the ability to put in the price paid and shares owned for your portfolio so you can track your performance. Also, you can now add alerts if the price falls above or below a specified level. And for those who want to separate things by portfolio or market, you can create different portfolios.
The default portfolio is there for demonstration: you can track domestic and foreign stocks, 3-month LIBOR, exchange rates, swap rates, indexes tracking everything from the broad market to the dollar to volatility, and futures. Heck, I've even thrown in the 5Y senior EUR CDS on Greece. You can clear everything in the options screen with the Clear button and start your own.
Note that for some securities, certain price data and charts aren't available.
Well, it's what you see here. The source is open, mostly so I have something to reference if I need to ask for help or if I want to check what I'm doing while away from home. Of course, the database isn't a part of the repository and any secret keys are stored in environment variables on my local machine and in "config vars":cfgvars on "heroku.com":heroku.
The site enables me to post both publicly for professional reasons and privately for staying in touch with folks back home. It also includes my résumé and links to some code I've done.