% Copyright (c) 2006-2009 by Ales Cerny %************************************************************************% % chapter12fig5.m - supplementary program to % % Ales Cerny (2009) Mathematical Techniques in Finance (2nd ed.) % % Princeton University Press http://press.princeton.edu/titles/9079.html % %************************************************************************% % This code is provided 'as-is', without any express or implied warranty. % % Permission is granted to anyone to use this code for any purpose, % subject to the following restrictions: % % 1. The origin of this code must not be misrepresented; you must not % claim that you wrote the original code. % 2. Modified code versions must be plainly marked as such, and must not % be misrepresented as being the original code. % 3. This notice may not be removed from any source distribution. % NOTICE TO STUDENTS: To avoid accusations of plagiarism, if you use this % code or its modifications in assessed work you should prepend it with a % note stating: % "This is the original/modified version of the code chapter12fig5.m by % Ales Cerny (2009), Mathematical Techniques in Finance (2nd ed.), % Princeton University Press. The original version is available from % http://www.martingales.info/mtfweb2". % A similar acknowledgement should appear prominently inside your written % report. clear; format long g; K=97; S=100; sig=0.2; T=1; r=0; dt=0.05; h=0.1; z = BSCall(S,K,r,T,sig); n=1:10; for j=n; y(j)=BSCallEFD2(S,K,r,T,sig,h/j,dt/(j^2)); end plot(n,y,'o-k',n,z*ones(1,length(n)),'--k') xlabel('1/\alpha'); ylabel('price'); title('Convergence of option prices, K = 100, node at strike');