Skip to content

Instantly share code, notes, and snippets.

@Daijunxu
Daijunxu / holtwinters.py
Created November 25, 2017 09:30 — forked from andrequeiroz/holtwinters.py
Implementation of Holt-Winters algorithms in Python 2
#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:
@Daijunxu
Daijunxu / Vectorizing
Created October 29, 2011 20:20
Vectorizing
%% 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))
% 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()