www.gusucode.com > fininst 案例源码程序 matlab代码 > fininst/CompoundOptionEQPEquityTreeExample.m

    %% Price a Compound Option Using an EQP Equity Tree
% This example shows how to price a compound option using a EQP equity tree by loading the file |deriv.mat|,
% which provides |EQPTree|. The |EQPTree| structure contains the stock specification and time information needed to price
% the option.
%%

% Copyright 2015 The MathWorks, Inc.

load deriv.mat
UOptSpec = 'Call';
UStrike = 130;
USettle = '01-Jan-2003';
UExerciseDates = '01-Jan-2006';
UAmericanOpt = 1;
COptSpec = 'Put';
CStrike = 5;
CSettle = '01-Jan-2003';
CExerciseDates = '01-Jan-2005';

Price = compoundbyeqp(EQPTree, UOptSpec, UStrike, USettle, ... 
UExerciseDates, UAmericanOpt, COptSpec, CStrike, CSettle, ... 
CExerciseDates)