<commit_before># OptionsPricing

Module for finance options pricing models in Ruby.  Right now, only supports Black Scholes.  I plan to add more models in the future.

## Installation

Just require it and include the module:
    require 'options_pricing'
    include OptionsPricing

Or in your Rails app as a plugin:

    script/plugin install git://github.com/phuphighter/options_pricing.git
    
## Usage
    
#### Examples

put or call = 'c', stock price = 75.15, strike = 80, years to maturity = 0.15, risk free rate = 0.15, volatility = 0.6

    >> option = black_scholes('c', 75.15, 80, 0.15, 0.25, 0.6)

Returns an object:    

    => <#Hashie::Mash call_put="c" d1=0.00843226590435667 d2=-0.223946734868088 risk_free_rate=0.25 stock_price=75.15 strike=80 value=6.12719273880037 volatility=0.6 years_to_maturity=0.15>

    >> option.value
    => 6.12719273880037
    
## Copyright

Contact me if you have any suggestions and feel free to fork it!

Copyright (c) 2009 <NAME>, released under the MIT license<commit_msg>edit readme<commit_after># OptionsPricing

Module for finance options pricing models in Ruby.  Right now, only supports Black Scholes.  I plan to add more models in the future.

## Installation

Just require it and include the module:
    require 'options_pricing'
    include OptionsPricing

Or in your Rails app as a plugin:

    script/plugin install git://github.com/phuphighter/options_pricing.git
    
## Usage
    
#### Examples

put or call = 'c', stock price = 75.15, strike = 80, years to maturity = 0.15, risk free rate = 0.15, volatility = 0.6

Returns an object: 
    >> option = black_scholes('c', 75.15, 80, 0.15, 0.25, 0.6)   
    => <#Hashie::Mash call_put="c" d1=0.00843226590435667 d2=-0.223946734868088 risk_free_rate=0.25 stock_price=75.15 strike=80 value=6.12719273880037 volatility=0.6 years_to_maturity=0.15>

    >> option.value
    => 6.12719273880037
    
## Copyright

Contact me if you have any suggestions and feel free to fork it!

Copyright (c) 2009 <NAME>, released under the MIT license
{'fraction_non_alphanumeric': 0.09980430528375733, 'fraction_numerical': 0.1095890410958904, 'mean_word_length': 3.7119815668202767, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3034658', 'n_tokens_mistral': 824, 'n_tokens_neox': 676, 'n_words': 228}