0
$\begingroup$

I'm trying to price an interest rate swap and would like to change the default coupon payment frequency from 1 a year to 2 or 4 a year. I'm using

Price = swapbyzero(RateSpec, LegRate, i, Maturity, 'Principal', Principal); 

and tried

Price = swapbyzero(RateSpec, LegRate, i, Maturity, 'Principal', Principal,'Period',2); 

where 'Period' is a valid option when pricing bond using

prbyzero

I'm using matlab 2013a

$\endgroup$
1
$\begingroup$

I don't know what is supported by MatLab (I use Java to do such stuff :-).

But in case you do not find a solution from the swapbyzero function you mentioned I can suggest a workaround:

  • Value a swap with the annual fix frequence.

Given that it is a payer swap (pays the fixed leg), correct the value by:

  • Substract the value of an annual fix coupon bond and
  • Add the value of the desired frequence fix coupon bond.

PS: Note that the MatLab function is likely not appropriate to value a swap in a "realistic" way, since it looks like multi-curve (OIS discounting) is not considered here (I wonder if term structure is considered?), see also Rationale for OIS discounting for collateralized derivatives?

$\endgroup$
0
$\begingroup$

Name-Value pair option 'LegReset' [n n] where n is the frequency

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.