error with bndprice command

3 ビュー (過去 30 日間)
Jens Petit-jean
Jens Petit-jean 2021 年 3 月 27 日
コメント済み: Jens Petit-jean 2021 年 3 月 27 日
Hello,
I always got the error 'CouponRate is required for all Bond instruments.' when using the bndprice command and I don't know what is wrong.
A=[0.02:0.005:0.05]
B=zeros(numel(A),2)
for i=1:numel(A)
[intrinsicValue,accruedInterest]=bndprice(0.045,A(i),'01-Mei-2016','30-Jun-2021')
B(i,1)=intrinsicValue
B(i,2)=accruedInterest
end
plot(B(1),B(2))
Thanks in advance

採用された回答

Walter Roberson
Walter Roberson 2021 年 3 月 27 日
Your spelling of May was not being recognized.
A=[0.02:0.005:0.05]
A = 1×7
0.0200 0.0250 0.0300 0.0350 0.0400 0.0450 0.0500
B=zeros(numel(A),2);
for i=1:numel(A)
[intrinsicValue,accruedInterest]=bndprice(0.045,A(i),'01-May-2016','30-Jun-2021');
B(i,1)=intrinsicValue;
B(i,2)=accruedInterest;
end
B
B = 7×2
88.5897 0.6703 90.8707 0.8379 93.1516 1.0055 95.4326 1.1731 97.7135 1.3407 99.9945 1.5082 102.2754 1.6758
plot(B(:,1),B(:,2))
  1 件のコメント
Jens Petit-jean
Jens Petit-jean 2021 年 3 月 27 日
Oh thanks forgot to put it in english

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePrice and Analyze Financial Instruments についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by