%% Create a Float-Float Swap and Price with hjmprice
% Use instswap to create a float-float swap and price the swap with hjmprice.

RateSpec = intenvset('Rates',.05,'StartDate',today,'EndDate',datemnth(today,60));
IS = instswap([.02 .03],today,datemnth(today,60),[], [], [], [1 1]);
VolSpec = hjmvolspec('Constant', .2);
TimeSpec = hjmtimespec(today,cfdates(today,datemnth(today,60),1));
HJMTree = hjmtree(VolSpec,RateSpec,TimeSpec);
hjmprice(HJMTree,IS)

% Copyright 2012 The MathWorks, Inc.