Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions src/primitives.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ class Instrument extends Definition {
this.commission = new InstrumentCommission(data['commission']);
}

if (data['financing'] !== undefined) {
this.financing = new InstrumentFinancing(data['financing']);
}

}
}

Expand Down Expand Up @@ -261,6 +265,45 @@ class GuaranteedStopLossOrderLevelRestriction extends Definition {
}
}

const InstrumentFinancing_Properties = [
new Property(
'longRate',
'longRate',
"The financing rate to be used for a long position for the instrument. The value is in decimal rather than percentage points, i.e. 5% is represented as 0.05.",
'primitive',
'primitives.DecimalNumber'
),
new Property(
'shortRate',
'shortRate',
"The financing rate to be used for a short position for the instrument. The value is in decimal rather than percentage points, i.e. 5% is represented as 0.05.",
'primitive',
'primitives.DecimalNumber'
),
];

class InstrumentFinancing extends Definition {
constructor(data) {
super();

this._summaryFormat = "";

this._nameFormat = "";

this._properties = InstrumentFinancing_Properties;

data = data || {};

if (data['longRate'] !== undefined) {
this.longRate = data['longRate'];
}

if (data['shortRate'] !== undefined) {
this.shortRate = data['shortRate'];
}
}
}

class EntitySpec {
constructor(context) {
this.context = context;
Expand Down