org.unizone.finance.interest

Type YieldForward

org.unizone.0.6350
Instance of Type
Inheriting from SourceAdapterSingleTimeseries

Type dataValue
org.uninode.Type.displayPattern{att:org.unizone.source.Source.displayName}
org.unizone.source.Source.valueAttribute
org.uninode.Resource.resourceType
org.uninode.Resource.label
org.uninode.Resource.resourceOfList{}
org.uninode.Listable.resourcesReference[org.uninode.Listable.resources] of org.unizone.finance.interest.YieldForward

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
StringlabelResourceorg.uninode.0.2041type
List[Type]resourceOfResourceorg.uninode.0.2042type
SignatureresourceType
This defines the type of resource. It can be 'view', 'adapter' or 'action'
Resourceorg.uninode.0.2043type
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
SourcesourceSourceAdapterSingleorg.unizone.0.4051

Method summaryDefined inOverridesProperties
voidactivateListable
voidcheckRangeSourceAdapterSingleSource
voiddesignEditor(WidgetWorkspace ws)Listable
voidgenerateScript(ScriptGenerationInfo info)SourceAdapterSingleScriptGenerator
Realget(DateTime timestamp)SourceAdapterSingleTimeseries
BooleanisResourceOf(Listable listable, Signature aspect)Mixabletype
ListablemixOn(Mixable mix)Mixable
ListablemixWith(Mixable mix)Mixable
voidput(DateTime timestamp, Real value)SourceAdapterSingleTimeseries
StringresourceStringListableintrospection
voidsetSource(Source source)SourceAdapterSingle
SourcesourceSourceAdapterSingle
voidXXXcom.nodelab.java.sourceadaptersingle.CheckRangeSourceAdapterSingle
SignatureXXXcom.nodelab.java.sourceadaptersingle.ValueTypeSourceAdapterSingle
voidcom.nodelab.java.source.ActivateSourceListable
Listablecom.nodelab.java.source.MixWithMiSourceMixable

Script summary
org.unizone.0.8538
/*
instance Yield yield;
constructor() {
  Source:();
}
constructor(YieldSwap yield) {
  Source:();
  instance yield = yield;
  addNextSource(instance yield);
}
class Boolean isResourceOf(Listable node, Symbol aspect) {
  if (aspect == #adaptors) return true;
  false;
}
class String resourceLabel() "Name of resource" {
  "forward yield";
}
String resourceString() "Description of resource" {
  "fwd " + instance yield.toString;
}
Symbol valueType() {#rate;}
Void setYield(Yield yield) {
  instance yield = yield;
  addNextSource(yield);
}
Mixable mixWith(Mixable item) {
  instance yield = Producer.mix(0);
  if (instance yield == null'  '!instance yield.class.subclassOf(Yield)) {
    Producer.report("Top mix must be a swap yield");
    return null;
  }
  addNextSource(instance yield);
  this;
}
Collection[Class] requiredConditions() {
  #(ConditionForward, ConditionHistory, ConditionMaturity);
}
Object preferredFrom(Condition condition) {
  if (condition.class == ConditionHistory) 
    return Time{ConditionHistory{condition}.to}.addDays(-30);
  Source:preferredFrom(condition);
}
Real forwardRate(Real s, Real ds) {
  if (ds <= 0) return null;
  Real t = s + ds;
  external cond_maturity = s;
  Real rateS = instance yield.aspectReal(#value) / 100;
  external cond_maturity = t;
  Real rateT = instance yield.aspectReal(#value) / 100;
  if (t - s < 1) {
    if (t < 1)
      return 100 * ((1 + t * rateT) / (1 + s * rateS) - 1) / ds;
    if (s < 1 && t > 1)
      return 100 * (((1 + rateT) ^ t) / (1 + s * rateS) - 1) / ds;
    return 100 * (((1 + rateT) ^ t) / ((1 + rateS) ^ s) - 1) / ds;
  }
  if (s < 1 && t > 1)
    return 100 * (((((1 + rateT) ^ t) / (1 + s * rateS)) ^ (1 / ds)) - 1);
  100 * (((((1 + rateT) ^ t) / ((1 + rateS) ^ s)) ^ (1 / ds)) - 1);
}

Real aspectReal(Symbol aspect) {
  forwardRate(external cond_maturity, external cond_forward);
}
Object aspectValue(Symbol aspect) {
  forwardRate(external cond_maturity, external cond_forward);
}
String instanceScript(InstanceScriptInfo info) {
  instance yield.instanceScript(info); // create variables
  info.objectId(this, AdaptorYieldForward, "fwd");
}
String initScript(InstanceScriptInfo info) {
  "  " + info.methodPrefix(this) + "setYield(" + instance yield.instanceScript(info) + ");
";
}

*/