Skip to main content

EventCurve

An EventCurve is a curve that is dynamically built from events.

Introduction

An EventCurve is a very flexible and dynamic way of expressing point-in-time based future values, both real and forecasted from events that are stored in your private database, the common database and the public database.

Construction

To construct a new EventCurve, you use the EventCurve function as shown in the syntax below:

curve = EventCurve(event, calendar, property, tenor)

An example of constructing a new EventCurve:

curve = EventCurve("AAA:EVENTS", "#REOMHENG", "price", "absolute")

Properties

An EventCurve has the following properties:

NameDescriptionType
eventThe name of the eventlist that this Curve uses (in the form objectId:eventListId)String
propertyThe name of the property in the event that this Curve uses as the valueString
tenorThe name of the property in the event that this Curve uses as the tenor/maturity codeString
calendarThe expiry calendar for this CurveString
holidayCalendarThe holiday calendar for this Curve - this is used to determine what dates this curve should be published onString
filterOptional filter used to filter the events used to build this CurveString
sourceOptional source of the events used to build this Curve. Can be private, common or public, defaults to privateString
valueTransformationOptional value transformation expression to change all values in the curve, e.g. 'value * 1.1'String
currencyAn optional currency codeString
unitsAn optional units codeString
propertiesAny other properties you want to add onto the curveObject
precisionThe precision configuration for this curvePrecision
includeAdditional properties from an event to add as columns in the curve contractsString or Array

Examples

Creating and saving an event curve

EC = EventCurve("AAA:EVENTS", "#REOMHENG", "price", "relative")
EC.precision.scale = 8
AAA = Object()
AAA.EC = EC
save AAA

Using value transformation

EC = EventCurve("AAA:EVENTS", "#REOMHENG", "price", "relative")
EC.valueTransformation = "value * 1.1"

Additional properties

You can include additional columns in the curve from event properties, using the include property, e.g.

EC = EventCurve("AAA:EVENTS", "#REOMHENG", "price", "relative")
EC.include = "vendorId"

To include multiple additional columns use an array, e.g.

EC = EventCurve("AAA:EVENTS", "#REOMHENG", "price", "relative")
EC.include = ["vendorId", "internalId"]

See Also