This is how you run an example barrier on DEKCEV.m
For Black-Scholes valuation, put gamma = 1
Up-and-out call barrier with
spot=100
strike = 100
barrier = 120
term = 1 year
dividend yield = 2.9559% continuously compounded
volatility = 15.0% per annum
risk free rate = 4.8790% continuously compounded
to be broken into following vanillas
with tenures = 2/12, 4/12, 6/12, 8/12, 10/12 and 12/12
and strikes = 120, 120, 120, 120, 120, 120.
----------------DEKCEV.m----------------------
time=[0 2/12 4/12 6/12 8/12 10/12 12/12];
tau=time;
K=[120 120 120 120 120 120 120];
[a, b]=DEKCEV(1, 1, 1, 100, 100, 120, 1, 0.15, 0.048790, 0.029559, 1.0, time, tau, K);
--------------------------------------------------
--------------CarrChou.m-----------------------
K=[120, 200, 300, 400, 600, 900]
x=K;
[a, b]=CarrChou(1, -1, 1, 100, 100, 120, K, x, 0.15, 0.048790, 0.029559, 1.0)