| org.unizone.finance.interest | ![]()  | 
org.unizone.0.6130
Instance of Type
Inheriting from Interest
A Bond is a finance instrument for fixed income. It may or may not have a coupon.
| Type data | Value | 
| org.uninode.Type.displayPattern | {att:org.unizone.finance.Ticker.tickerId} | 
| org.unizone.source.Source.valueAttribute | org.unizone.finance.Index.last | 
| org.uninode.Listable.resources | Reference[org.uninode.Listable.resources] of org.unizone.finance.interest.Bond | 
| Attribute summary | Defined in | Uninode® Id | Properties | Default | |
| Reference[org.uninode.Listable.resources] | resources | Listable | org.uninode.0.2001 | type | |
| String | toString This is the display string.  | Node | org.uninode.0.102 | ||
| Type | type The type of an object determines the behaviour and attributes of the object.  | Node | org.uninode.0.101 | ||
| String | uri | Node | org.uninode.0.103 | ||
| Ticker | underlying This is the index that determines the theoretical price of the derivative.  | Derivative | org.unizone.0.5031 | essential | |
| Real | closeMidnight This is the yesterday closing index.  | Index | org.unizone.0.5002 | ||
| Real | high | Index | org.unizone.0.5003 | ||
| Real | last This is the index value.  | Index | org.unizone.0.5001 | ||
| Real | low | Index | org.unizone.0.5004 | ||
| TickerLeaf | product | Ticker | org.unizone.0.10765 | ||
| String | tickerId This is the id of a ticker. The selection attribute determines the current selection from all products with the same tickerLeafId as this tickerId.  | Ticker | org.unizone.0.5121 | ||
| DateTime | maturity This is the date when the debt may be collected.  | Debt | org.unizone.0.5401 | ||
| String | displayName The display name is the name that is shown in lists, displays and graphs.  | Source | org.unizone.0.4001 | essential | |
| Attribute | valueAttribute The value attribute is used for determining the default value that should be used for displaying this source in a graph.  | Source | org.unizone.0.4011 | type inheritValue  | |
| Signature | valueType The value type determines which axes should be used in graphs.  | Source | org.unizone.0.4002 | inheritValue | |
| Method summary | Defined in | Overrides | Properties | |
| void | activate | Listable | ||
| void | checkRange | Source | ||
| void | collectSteps(List steps, Dimension dimensionType) | Source | ||
| void | collectValues(List steps, List values, Type dimensionType) | Source | ||
| void | designEditor(WidgetWorkspace ws) | Listable | ||
| Real | evaluate | Source | ||
| void | generateScript(ScriptGenerationInfo info) | Source | ScriptGenerator | |
| Boolean | isResourceOf(Listable listable, Signature aspect) | Mixable | type | |
| Listable | mixOn(Mixable mix) | Mixable | ||
| Listable | mixWith(Mixable mix) | Mixable | ||
| String | resourceString | Listable | introspection | |
| Real | timeseries(Signature aspect) | Source | ||
| Signature | valueType | Source | introspection | |
| void | com.nodelab.java.source.Activate | Source | Listable | |
| Listable | com.nodelab.java.source.MixWithMi | Source | Mixable | |
| Script summary | 
org.unizone.0.8535/*
constructor() {
  InstrumentInterest:(); 
}
Array[Symbol] defaultAspects() {
  #(#bid, #maturity, #coupon);
}
class Real dirtyPriceGreek(Time settlementDate, Time maturity, Real rate, Real coupon) {
  if (rate == null) return null;
  Time couponDate = maturity;
  if (maturity < settlementDate) return null;
  Real t = couponDate.subtractDate360(settlementDate) / 360.0;
  Real price = 100 / (1 + rate / 100) ^ t;
  while ((t = couponDate.subtractDate360(settlementDate) / 360.0) >= 0) {
    if (t < 1) t = couponDate.subtractDate(settlementDate) / 365.0;
    price = price + coupon / (1 + rate / 100) ^ t;
    couponDate = couponDate.addYears(-1);
  }
  price;
}
Real dirtyPriceGreek() {
  dirtyPriceGreek(
    Time{external cond_history}.settlement(settlementDays()),
    Time{aspectValue(#maturity)},
    aspectReal(#value),
    aspectReal(#coupon))
}
class Real cleanPriceQuote(Time settlementDate, Time maturity, Real rate, Real coupon) {
  Real price = dirtyPriceGreek(settlementDate, maturity, rate, coupon);
  if (price == null) return null;
  Time couponDate = maturity;
  Real t;
  while ((t = couponDate.subtractDate360(settlementDate) / 360.0) >= 1)
    couponDate = couponDate.addYears(-1);
  return ((price - (coupon * (1 - t))) * 1000).round / 1000.0;
}
class Real dirtyPriceQuote(Time settlementDate, Time maturity, Real rate, Real coupon) {
  Real clean = cleanPriceQuote(settlementDate, maturity, rate, coupon);
  if (clean == null) return null;
  Time couponDate = maturity;
  Real t;
  while ((t = couponDate.subtractDate360(settlementDate) / 360.0) >= 1)
    couponDate = couponDate.addYears(-1);
  return ((clean + coupon * (1 - t)) * 1000000).round / 1000000.0;
}
class Real delta(Time settlementDate, Time maturity, Real rate, Real coupon) {
  Real step = 0.01;
  5000 *
    (dirtyPriceQuote(settlementDate, maturity, rate - step, coupon) -
     dirtyPriceQuote(settlementDate, maturity, rate + step, coupon));
}
class Real convexity(Time settlementDate, Time maturity, Real rate, Real coupon) {
  Real step = 0.01;
  Real tmp = 
    dirtyPriceQuote(settlementDate, maturity, rate + step, coupon) +
    dirtyPriceQuote(settlementDate, maturity, rate - step, coupon) -
    2 * dirtyPriceQuote(settlementDate, maturity, rate, coupon);
  tmp / (step ^ 2);
}
class Real duration(Time settlementDate, Time maturity, Real rate, Real coupon) {
  if (rate == null) return null;
  Time couponDate = maturity;
  if (maturity < settlementDate) return null;
  Real t = couponDate.subtractDate360(settlementDate) / 360.0;
  Real price = 100 * t / (1 + rate / 100) ^ t;
  while ((t = couponDate.subtractDate360(settlementDate) / 360.0) >= 0) {
    if (t < 1) t = couponDate.subtractDate(settlementDate) / 365.0;
    price = price + coupon * t / (1 + rate / 100) ^ t;
    couponDate = couponDate.addYears(-1);
  }
  price / dirtyPriceGreek(settlementDate, maturity, rate, coupon);
}
class Real modDuration(Time settlementDate, Time maturity, Real rate, Real coupon) {
  duration(settlementDate, maturity, rate, coupon) / (1 + rate / 100)
}
*/
 |