% % Written by: % -- % John L. Weatherwax 2006-12-31 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- close all; E = 5; S = linspace(E-20,E+20)'; PC = max([S-E,zeros(size(S))],[],2); PP = max([E-S,zeros(size(S))],[],2); figure; hold on; grid on; ch=plot( S, PC, '-g' ); ph=plot( S, PP, '-rx' ); nph=plot( S, -PP, '-ro' ); legend( [ch,ph,nph], {'Call: max(0,S-E)', 'Put: max(0,E-S)', '-Put: -max(0,E-S)'} ); axis( [ -15 +25 -15 40 ] ); xlabel('stock price at expiration'); ylabel('option value'); %saveas( gcf, '../../WriteUp/Graphics/prob_5_7_cp_plot', 'epsc' );