matlab 期权图,期权定价matlab程序.docx

1.三叉树法matlab程序%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Computes the Boyle (1986) Trinomial Tree for American Call/Put Option Values based % on the following inputs: % CallPut = Call = 1, Put = 0 % AssetP = Underlying Asset Price % Strike = Strike Price of Option % RiskFree = Risk Free rate of interest % Div = Dividend Yield of Underlying % Time = Time to Maturity % Vol = Volatility of the Underlying % nSteps = Number of Time Steps for Trinomial Tree to take %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CallPut=0; %Call = 1, Put = 0 AssetP=50; %Underlying Asset Price Strike=50; %Strike Price of Option RiskFree=0.1; %Risk Free rate of interest Div=0; %Dividend Yield of Underlying Time=5/12; %Time to Maturity Vol=0.4; %Volatility of the Underlying nSteps=200; %Number of Time Steps for Trinomial Tree to take %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%dt = Time / nSteps; % Allocates the time steps cc = RiskFree - Div; % Specifies the cost of carry (r - D) if CallPut b = 1; end if ~CallPut b = -1; end RR = exp(RiskFree * dt); Up = exp(Vol * sqrt(2 * dt)); % The magnitude of an up movement Down = 1 / Up; % The magnitude of a down movement %%% Specifies the probability of up, down and mid moves for trinomial tree P_up = ((exp(cc * dt / 2) - exp(-Vol * sqrt(dt / 2))) / (exp(Vol * sqrt(dt / 2)) - exp(-Vol * sqrt(dt / 2)))) ^ 2; P_down = ((exp(Vol * sqrt(dt / 2)) - exp(cc * dt / 2)) / (exp(Vol * sqrt(dt / 2)) - exp(-Vol * sqrt(dt / 2)))) ^ 2; P_mid = 1 - P_up - P_down; Df = exp(-RiskFree * dt); % Sets up the asset movements on the t

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值