Created
October 17, 2011 23:30
-
-
Save elee/1294184 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function [vega] = calculate_vega(S,K,r,T,sigma,N,q,option_parity,option_type) | |
| vol_change = 0.01; | |
| % change constantly volatility inputs, recalculate option prices | |
| price_difference = priceit_(S,K,r,T,sigma+vol_change,N,q,option_parity,option_type) ... | |
| - priceit_(S,K,r,T,sigma-vol_change,N,q,option_parity,option_type); | |
| % take changes in option prices and divide by twice volatility difference | |
| vega = price_difference / (2 * vol_change); | |
| end |
elee
commented
Oct 25, 2011
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment