//
//  EXERCISE 1: ARBITRAGE EXAMPLE
//

// Definitions of payoffs

function [cp]=CallPayoff(S,E)
    cp=max(S-E,0);
endfunction;

function [pp]=PutPayoff(S,E)
    pp=max(E-S,0);
endfunction;

// Data

e=[10 15 20 25 30];  // expiration prices
v=[30 26 27 23 19];  // option prices

figure(1);
a=gca();
a.background=color("white");
a=gcf();
a.background=color("white");

plot(e,v); plot(e,v,'*');

// Plot a profit diagram of an arbitrage strategy

