org.unizone.finance.interest

Type Bond

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 dataValue
org.uninode.Type.displayPattern{att:org.unizone.finance.Ticker.tickerId}
org.unizone.source.Source.valueAttributeorg.unizone.finance.Index.last
org.uninode.Listable.resourcesReference[org.uninode.Listable.resources] of org.unizone.finance.interest.Bond

Attribute summaryDefined inUninode® IdPropertiesDefault
Reference[org.uninode.Listable.resources]resourcesListableorg.uninode.0.2001type
StringtoString
This is the display string.
Nodeorg.uninode.0.102
Typetype
The type of an object determines the behaviour and attributes of the object.
Nodeorg.uninode.0.101
StringuriNodeorg.uninode.0.103
Tickerunderlying
This is the index that determines the theoretical price of the derivative.
Derivativeorg.unizone.0.5031essential
RealcloseMidnight
This is the yesterday closing index.
Indexorg.unizone.0.5002
RealhighIndexorg.unizone.0.5003
Reallast
This is the index value.
Indexorg.unizone.0.5001
ReallowIndexorg.unizone.0.5004
TickerLeafproductTickerorg.unizone.0.10765
StringtickerId
This is the id of a ticker. The selection attribute determines the current selection from all products with the same tickerLeafId as this tickerId.
Tickerorg.unizone.0.5121
DateTimematurity
This is the date when the debt may be collected.
Debtorg.unizone.0.5401
StringdisplayName
The display name is the name that is shown in lists, displays and graphs.
Sourceorg.unizone.0.4001essential
AttributevalueAttribute
The value attribute is used for determining the default value that should be used for displaying this source in a graph.
Sourceorg.unizone.0.4011type
inheritValue
SignaturevalueType
The value type determines which axes should be used in graphs.
Sourceorg.unizone.0.4002inheritValue

Method summaryDefined inOverridesProperties
voidactivateListable
voidcheckRangeSource
voidcollectSteps(List steps, Dimension dimensionType)Source
voidcollectValues(List steps, List values, Type dimensionType)Source
voiddesignEditor(WidgetWorkspace ws)Listable
RealevaluateSource
voidgenerateScript(ScriptGenerationInfo info)SourceScriptGenerator
BooleanisResourceOf(Listable listable, Signature aspect)Mixabletype
ListablemixOn(Mixable mix)Mixable
ListablemixWith(Mixable mix)Mixable
StringresourceStringListableintrospection
Realtimeseries(Signature aspect)Source
SignaturevalueTypeSourceintrospection
voidcom.nodelab.java.source.ActivateSourceListable
Listablecom.nodelab.java.source.MixWithMiSourceMixable

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)
}

*/