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

    %% Price Multiple Swaps with |hjmprice|

%% 
% Use |instswap| to create multiple swaps and price the swaps with |hjmprice|. 
RateSpec = intenvset('Rates',.05,'StartDate',today,'EndDate',datemnth(today,60));
IS = instswap([.03 .02],today,datemnth(today,60),[], [], [], [1 1]);
IS = instswap(IS,[200 300],today,datemnth(today,60),[], [], [], [0 0]);
IS = instswap(IS,[.08 300],today,datemnth(today,60),[], [], [], [1 0]);
VolSpec = hjmvolspec('Constant', .2);
TimeSpec = hjmtimespec(today,cfdates(today,datemnth(today,60),1));
HJMTree = hjmtree(VolSpec,RateSpec,TimeSpec);
hjmprice(HJMTree,IS)