GetEventOffset

GetEventOffset ( int eventType, int numberOfEventsToSkip);

Default values:

eventType: Events.DIVIDEND numberOfEventsToSkip: 0

Description

Returns number of bars before an upcoming or after a past event. The eventType parameter uses an Events constant to specify the type of the event: conference call, dividend, split, or earnings announcement. The numberOfEventsToSkip parameter defines which event of the specified type should be used: negative values define the number of the event in retrospective order, other values define upcoming events with zero corresponding to the closest one. Note that the sign of the value returned by this function is opposite to that of the numberOfEventsToSkip parameter: positive values for negative numberOfEventsToSkip, negative for zero or positive numberOfEventsToSkip.

Input parameters

Parameter Default value Description
eventType Events.DIVIVDEND Defines the type of event since/until which bars are counted.
numberofEventsToSkip 0 If negative, defines number of a past event, otherwise, number of the upcoming one. Zero value corresponds to the closest upcoming event.

Example

AddChartBubble(
HasConferenceCall(),
high,
"The last conference call was " +
GetEventOffset(Events.CONFERENCE_CALL, -1) +
" bars ago");

This example script displays a chart bubble indicating the number of bars since the most recent conference call.