Caplin Trader 4.7.1

Class: module:caplin/alerts/Trigger

module:caplin/alerts/Trigger

A trigger is a monitor of an instrument that will raise a module:caplin/alerts/Notification when a given condition is met. Triggers should only be constructed by implementations of module:caplin/alerts/TriggerService. The constructor takes a module:caplin/core/EmittingMap enabling the service to change the trigger's properties without public setters. When the 'state' property is changed, the trigger will raise a STATE_CHANGED event (defined in module:caplin/alerts/TriggerEvents).

Constructor

new module:caplin/alerts/Trigger(properties)

Parameters:
Name Type Description
properties module:caplin/core/EmittingMap The properties of this trigger. It should define 'subject', 'condition' and 'state' properties.

Methods

getCondition() → {String}

Returns:
The condition that, when met, will cause this trigger to raise a module:caplin/alerts/Notification.
Type
String

getState() → {module:caplin/alerts/TriggerStates}

Returns:
The state that the trigger is currently in.
Type
module:caplin/alerts/TriggerStates

getSubject() → {String}

Returns:
The subject of the instrument that this trigger is monitoring.
Type
String