Pricing a bond with different YTM (at cross sectional level)
Ältere Kommentare anzeigen
Dear Sir or Madam
I was wondering if there is a function in matlab that prices bonds with different YTM?. For example:
Bond price= coupon/(YTM_1) +coupon/(YTM_2)^2+.................+coupon/(YTM_n)^n
Thank you very much
S
Antworten (3)
Oleg Komarov
am 29 Jun. 2011
N = 100;
C = 5; %Semi-annual
YTM = rand(1,10)*.1;
P = sum([C./(1+YTM(1:9)).^(1:9), (N+C)/(1+YTM(10))^10]);
Fangjun Jiang
am 29 Jun. 2011
0 Stimmen
Saad
am 30 Jun. 2011
0 Stimmen
1 Kommentar
Oleg Komarov
am 6 Jul. 2011
You can still apply a vectorized solution from my example.
To be more precise you need to provide an example on how you stored all of that info.
Kategorien
Mehr zu Financial Toolbox finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!