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
#The MIT License (MIT) | |
# | |
#Copyright (c) 2015 Andre Queiroz | |
# | |
#Permission is hereby granted, free of charge, to any person obtaining a copy | |
#of this software and associated documentation files (the "Software"), to deal | |
#in the Software without restriction, including without limitation the rights | |
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
#copies of the Software, and to permit persons to whom the Software is | |
#furnished to do so, subject to the following conditions: |
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
%% Import test data | |
CLC=xlsread('CL.xlsx','CallOptions'); | |
%% plot and compare | |
figure % CL | |
% Call option of CL | |
% Bisection methods | |
[EstimatedPrice,Interations,CL_B_call_bid]=arrayfun(@bisection_iv,CLC(:,3),CLC(:,1),CLC(:,2),0.0012.*ones(length(CLC),1),0.25.*ones(length(CLC),1)); | |
subplot(2,2,1);plot(CL_B_call_bid,CLC(:,2)) |
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
% Implied Volatility Calculator | |
% Daijun Xu | |
% Project 3 | |
%% | |
% The function will estimate the market implied volatility of put and call | |
% options based on Black Scholers model. I got CL and MSFT option data from | |
% Yahoo!Finance for vectorization test and plot. And you can also use your | |
% own data(as scalars) to calculate. | |
%% | |
function []=IV_calculator() |