-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not getting the greeks other than IV #2
Comments
Hi @didieruzan ! Glenn |
Hi @gnagel Thanks! |
Hi @gnagel, I just realised I didn't supply you a sample code as you requested, so here it is: You'll notice that calc_result does not include delta, gamma, vega, rho nor theta, even though it should according to documentation. Thank you in advance. |
Hi @didieruzan opts = {:stock_price=>4.04, :stock_dividend_rate=>0.0, :option_type=>nil, :option_price=>0.17, :option_strike=>3.5, :option_expires_in_days=>50.0, :federal_reserve_interest_rate=>0.03, :option_volume=>100.0, :option_open_interest=>0.0, :option_type => :put}
calc_result = Math::Greeks::Calculator.new(opts)
puts calc_result.to_hash
# {
# :federal_reserve_interest_rate=>0.03,
# :stock_dividend_rate=>0.0,
# :stock_price=>4.04,
# :option_expires_in_days=>50.0,
# :option_type=>:put,
# :option_strike=>3.5,
# :option_price=>0.17,
# :option_volume=>100.0,
# :option_open_interest=>0.0,
# :premium_value=>0.0,
# :time_value=>0.17,
# :annualized_premium_value=>33.94,
# :annualized_time_value=>33.94,
# :iv=>68.02,
# :delta=>-5.81,
# :gamma=>-5.05,
# :vega=>1.9,
# :rho=>-0.95,
# :theta=>-1.86,
# :delta_vs_theta=>3.13,
# :break_even=>26.33
# } |
I'll add some debugging helpers to the module to make it clearer when an error occurs, as well as push up the V2 of this library with a cleaner syntax & more tests. |
Thank you! Didier Uzan On Mon, Feb 22, 2016 at 6:33 PM G Nagel notifications@github.com wrote:
+972 54 779 3384 |
Hi,
I am using Math::Greeks::Calculator.new(...) to calculate the greeks, as in your example, but I am not getting any greeks in the result object (delta, gamma, etc...), I am only getting IV.
Could you explain how to retrieve the rest of the greeks.
Thank you in advance,
Didier
The text was updated successfully, but these errors were encountered: