|
WebCab Bonds Demo (J2EE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Within this Enterprise JavaBean we offer functionality related to the evaluation of the price and yield of a government backed bond (i.e. Treasury bond) issued in the local currency.
| Method Summary | |
double |
parYield(double principalSum,
Date evaluationDate,
Date maturityDate,
boolean annualOrSemi,
double maturityZero,
Date[] paymentDates,
double[] zeroCurveOnCouponPaymentDates,
BusinessCalendar businessCalendar)
We evaluate the Par Yield of a Treasury bond which pays annual or semi-annual coupons. |
double |
parYield(double principalSum,
double maturity,
boolean annualOrSemi,
double maturityZero,
double[] timeToCoupons,
double[] zeroCurveOnCouponPaymentDates)
We evaluate the Par Yield of a Treasury bond which pays annual or semi-annual coupons. |
double |
priceOfBond(double principleSum,
Date evaluationDate,
Date maturity,
double zeroRateAtMaturity,
double[] payments,
Date[] paymentDates,
double[] zeroRates,
BusinessCalendar businessCalendar)
Evaluates the price of a Treasury bond by discounting the cash flows until maturity in accordance with the corresponding continuously compounded zero rate. |
double |
priceOfBond(double principleSum,
double time2Maturity,
double zeroRateAtMaturity,
double[] payments,
double[] time2Payments,
double[] zeroRates)
Evaluates the price of a Treasury bond by discounting the cash flows until maturity in accordance with the corresponding continuously compounded zero rate. |
double |
tbondPrice(double principleSum,
double riskFreeRate,
Date evaluationDate,
Date maturityDate,
double[] coupons,
Date[] dateOfCoupons,
BusinessCalendar businessCalendar)
Evaluates the price of a Treasury bond by discounting the future cash flows in accordance with the risk free interest rate. |
double |
tbondPrice(double principleSum,
double riskFreeRate,
double time2Maturity,
double[] coupons,
double[] time2Coupons)
Evaluates the price of a Treasury bond by discounting the future cash flows in accordance with the risk free interest rate. |
double |
yieldToMaturity(double principalSum,
double marketPrice,
Date previousCouponDate,
Date evaluationDate,
Date settlementDate,
Date[] paymentDates,
Date maturityDate,
double[] couponPayments,
BusinessCalendar businessCalendar,
String dayCountConvention)
The yield to maturity (YTM) (also known as the internal rate of return) with continuous compounding is calculated for a traded bond. |
double |
yieldToMaturity(double principalSum,
double marketPrice,
double time2Maturity,
double[] time2Payments,
double[] couponPayments)
The yield to maturity (YTM) (also known as the internal rate of return) with continuous compounding is calculated for a traded bond. |
double |
yieldToMaturityFromPrice(double price,
double[] payments,
Date evaluationDate,
Date[] paymentDates,
BusinessCalendar businessCalendar)
Here the yield to maturity of a bond is derived from its price, payments and time of these payments. |
double |
yieldToMaturityFromPrice(double price,
double[] payments,
double[] time2Payments)
Here the yield to maturity of a bond is derived from its price, payments and time of these payments. |
double |
zeroTBondPrice(double principle,
double riskFreeRate,
Date evaluationDate,
Date maturityDate,
BusinessCalendar businessCalendar)
This method returns the price of a zero-coupon Treasury bond. |
double |
zeroTBondPrice(double principle,
double riskFreeRate,
double time2Maturity)
This method returns the price of a zero-coupon Treasury bond. |
double |
zeroYieldToMaturity(double principalSum,
double marketPrice,
Date evaluationDate,
Date maturityDate,
BusinessCalendar businessCalendar)
Evaluates the yield to maturity (YTM) (also known as the internal rate of return) of a zero coupon bond. |
double |
zeroYieldToMaturity(double principalSum,
double marketPrice,
double timeToMaturity)
Evaluates the yield to maturity (YTM) (also known as the internal rate of return) of a zero coupon bond. |
| Methods inherited from interface javax.ejb.EJBObject |
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove |
| Method Detail |
public double priceOfBond(double principleSum,
Date evaluationDate,
Date maturity,
double zeroRateAtMaturity,
double[] payments,
Date[] paymentDates,
double[] zeroRates,
BusinessCalendar businessCalendar)
throws TreasuryPriceDemoException,
RemoteException
principleSum - the principle sum of the bond which will be repaid at maturityzeroRateAtMaturity - the corresponding continuously compounded zero rate of the maturitypayments - an array of doubles where the first element represents the first payments from the bond, the second the second payment and so on.zeroRates - an array where the first element is the zero rate on the first payment date and the second term is the zero rate on the second payment date and so on.evaluationDate - the date on which the price of the bond is evaluatedmaturity - the date on which the bond maturespaymentDates - an array of dates where the first element corresponds to the date of the first payment and the second element corresponds to the date of the second payment and so on.businessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.
TreasuryPriceDemoException
RemoteException
public double priceOfBond(double principleSum,
double time2Maturity,
double zeroRateAtMaturity,
double[] payments,
double[] time2Payments,
double[] zeroRates)
throws TreasuryPriceDemoException,
RemoteException
principleSum - the principle sum of the bond which will be repaid at maturitytime2Maturity - the time in years until the bond matureszeroRateAtMaturity - the corresponding continuously compounded zero rate of the maturitypayments - an array of doubles where the first element represents the first payments from the bond, the second the second payment and so on.time2Payments - an array of doubles where the first element represents the time until the first payment is made, the second the time until the second payment is made and so on.zeroRates - an array where the first element is the zero rate on the first payment date and the second term is the zero rate on the second payment date and so on.
TreasuryPriceDemoException
RemoteException
public double tbondPrice(double principleSum,
double riskFreeRate,
Date evaluationDate,
Date maturityDate,
double[] coupons,
Date[] dateOfCoupons,
BusinessCalendar businessCalendar)
throws TreasuryPriceDemoException,
RemoteException
principleSum - the principle sum which will be repaid at expiryriskFreeRate - the continuously compounded annual risk free interest rate expressed in decimal formatcoupons - an array where the first term corresponds to the amount paid by the next coupon payment and the second term corresponds to the amount paid by the coupon payment after that and so onevaluationDate - the date of the evaluation of the price of the government backed bondmaturityDate - the date when the bond maturesdateOfCoupons - an array of dates where the first element corresponds to the date of the next coupon payment and the second term corresponds to the second coupon payment and so on.businessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.
TreasuryPriceDemoException
RemoteException
public double tbondPrice(double principleSum,
double riskFreeRate,
double time2Maturity,
double[] coupons,
double[] time2Coupons)
throws TreasuryPriceDemoException,
RemoteException
principleSum - the principle sum which will be repaid at expiryriskFreeRate - the continuously compounded annual risk free interest rate expressed in decimal formattime2Maturity - the number of years until the bond matures expressed in decimal formatcoupons - an array where the first term corresponds to the amount paid by the next coupon payment and the second term corresponds to the amount paid by the coupon payment after that and so ontime2Coupons - an array where the first term corresponds to the number of years until the first coupon payment and the second term corresponds to the number of years until the second payment is made and so on... Note that the number of years must be expressed in decimal format (i.e. 3 years 6 months = 3.5)
TreasuryPriceDemoException
RemoteException
public double zeroTBondPrice(double principle,
double riskFreeRate,
Date evaluationDate,
Date maturityDate,
BusinessCalendar businessCalendar)
throws TreasuryPriceDemoException,
RemoteException
principle - the amount which is repaid at maturity of the bondriskFreeRate - the risk free interest rate in the local currency expressed in decimal format (i.e. 1 percent = 0.01)evaluationDate - the date on which the bonds price is evaluatedmaturityDate - the date on which the bond maturesbusinessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.
TreasuryPriceDemoException
RemoteException
public double zeroTBondPrice(double principle,
double riskFreeRate,
double time2Maturity)
throws TreasuryPriceDemoException,
RemoteException
principle - the amount which is repaid at maturity of the bondriskFreeRate - the risk free interest rate in the local currency expressed in decimal format (i.e. 1 percent = 0.01)time2Maturity - the time in years (in decimal format) until the bond matures
TreasuryPriceDemoException
RemoteException
public double yieldToMaturity(double principalSum,
double marketPrice,
Date previousCouponDate,
Date evaluationDate,
Date settlementDate,
Date[] paymentDates,
Date maturityDate,
double[] couponPayments,
BusinessCalendar businessCalendar,
String dayCountConvention)
throws TreasuryPriceDemoException,
RemoteException
Remark: This method uses the Newton-Raphson procedure and produces a result which is accurate to 10 decimal places.
principalSum - the principal sum which will be repaid at expirymarketPrice - the market price of the bondcouponPayments - an array where the first term corresponds to the amount paid by the next coupon payment and the second term corresponds to the amount paid by the coupon payment after that and so onpreviousCouponDate - the date of the last payment before the evaluation date, or the date of the issue of the bond. Set to the evaluation or settlement date if does not apply.evaluationDate - the date on which the yield to maturity (YTM) is evaluatedsettlementDate - the date when the contract is being fulfilledmaturityDate - the date on which the bond maturespaymentDates - an array of dates where the first term corresponds to the date of the first payment and the second term corresponds to the date of the second payment and so on.businessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.dayCountConvention - A string constant identifying one of the implemented day count conventions in the DayCountConventions class. The default day count convention is `Actual/Actual', identified by the "A/A" string constant.
TreasuryPriceDemoException
RemoteException
public double yieldToMaturity(double principalSum,
double marketPrice,
double time2Maturity,
double[] time2Payments,
double[] couponPayments)
throws TreasuryPriceDemoException,
RemoteException
Remark: This method uses the Newton-Raphson procedure and produces a result which is accurate to 10 decimal places.
principalSum - the principal sum which will be repaid at expirymarketPrice - the market price of the bondtime2Maturity - the number of years until the bond matures expressed in decimal formatcouponPayments - an array where the first term corresponds to the amount paid by the next coupon payment and the second term corresponds to the amount paid by the coupon payment after that and so ontime2Payments - an array where the first term corresponds to the number of years until the first coupon payment and the second term corresponds to the number of years until the second payment is made and so on... Note that the number of years must be expressed in decimal format.
TreasuryPriceDemoException
RemoteException
public double zeroYieldToMaturity(double principalSum,
double marketPrice,
Date evaluationDate,
Date maturityDate,
BusinessCalendar businessCalendar)
throws TreasuryPriceDemoException,
RemoteException
principalSum - the principal sum which will be repaid at expirymarketPrice - the present market price of the bondevaluationDate - the date on which the yield to maturity (YTM) of the zero bond is evaluatedmaturityDate - the date when the zero bond maturesbusinessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.
TreasuryPriceDemoException
RemoteException
public double zeroYieldToMaturity(double principalSum,
double marketPrice,
double timeToMaturity)
throws TreasuryPriceDemoException,
RemoteException
principalSum - the principal sum which will be repaid at expirymarketPrice - the present market price of the bondtimeToMaturity - the time in years (expressed in decimal format) until the bond matures
TreasuryPriceDemoException
RemoteException
public double yieldToMaturityFromPrice(double price,
double[] payments,
Date evaluationDate,
Date[] paymentDates,
BusinessCalendar businessCalendar)
throws TreasuryPriceDemoException,
RemoteException
price - the market price of the bondpayments - an array of doubles where the first element represents the first coupon payment the second element the second coupon payment and so on until the final payment, which will represent the payment of the bonds principal sumevaluationDate - the date when the yield of the bond is evaluatedpaymentDates - an array of dates where the first term corresponds to the first payment date, the second term corresponds to the second payment date and so on, until the final term which will represent the payment of the principal sum at the maturity of the bondbusinessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.
TreasuryPriceDemoException
RemoteException
public double yieldToMaturityFromPrice(double price,
double[] payments,
double[] time2Payments)
throws TreasuryPriceDemoException,
RemoteException
price - the market price of the bondpayments - an array of doubles where the first element represents the first coupon payment the second element the second coupon payment and so on until the final payment, which will represent the payment of the bonds principal sumtime2Payments - an array of doubles where the first element represents the time in years until the first payment, the second term represents the time in years until the second payment and so on... Until the final term which represents the time in years until the principal sum of bond is paid, or equivalently the time in years until expiry.
TreasuryPriceDemoException
RemoteException
public double parYield(double principalSum,
Date evaluationDate,
Date maturityDate,
boolean annualOrSemi,
double maturityZero,
Date[] paymentDates,
double[] zeroCurveOnCouponPaymentDates,
BusinessCalendar businessCalendar)
throws TreasuryPriceDemoException,
RemoteException
The Treasury bonds Par yield is evaluated using the zero term structure of the corresponding Treasury zero curve. In order to apply this approach the zero curve will need to be evaluated on maturities which correspond to the coupon payment dates. For example, if we consider a two year bond which pays a semiannual coupon then the Treasury zero rates will need to be known for the maturities 0.5, 1, 1.5 and 2 years.
principalSum - the principal sum (also known as the face value) of the bondannualOrSemi - when the coupon is paid annually then this parameter is true and if the coupon is paid semi-annually then it is falsematurityZero - the zero rate for the maturity of the bond under considerationzeroCurveOnCouponPaymentDates - an array where the first term is the Treasury zero interest rate of maturity equal to the time until the first coupon payment, and the second term is the Treasury zero interest rate of maturity equal to the time until the second coupon payment, and so on...evaluationDate - the date when the Par Yield is evaluatedmaturityDate - the date when the bond maturespaymentDates - an array of dates where the first element is the date of the first coupon payment and the second element is the date of the second coupon payment and so onbusinessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.
TreasuryPriceDemoException
RemoteException
public double parYield(double principalSum,
double maturity,
boolean annualOrSemi,
double maturityZero,
double[] timeToCoupons,
double[] zeroCurveOnCouponPaymentDates)
throws TreasuryPriceDemoException,
RemoteException
The Treasury bonds Par yield is evaluated using the zero term structure of the corresponding Treasury zero curve. In order to apply this approach the zero curve will need to be evaluated on maturities which correspond to the coupon payment dates. For example, if we consider a two year bond which pays a semiannual coupon then the Treasury zero rates will need to be known for the maturities 0.5, 1, 1.5 and 2 years.
principalSum - the principal sum (also known as the face value) of the bondmaturity - the maturity of the bond in years expressed in decimal formatannualOrSemi - when the coupon is paid annually then this parameter is true and if the coupon is paid semi-annually then it is falsematurityZero - the zero rate for the maturity of the bond under considerationtimeToCoupons - an array where the first term is the number of years expressed as a decimal until the first coupon payment is made, and the second term is the number of years until the second coupon payment is made and so on...zeroCurveOnCouponPaymentDates - an array where the first term is the Treasury zero interest rate of maturity equal to the time until the first coupon payment, and the second term is the Treasury zero interest rate of maturity equal to the time until the second coupon payment, and so on...
TreasuryPriceDemoException
RemoteException
|
WebCab Bonds Demo (J2EE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||