Caplin Trader 5.1.0

Class: module:ct-alerts/Trigger

module:ct-alerts/Trigger(properties)

A trigger is a monitor of an instrument that will raise a module:ct-alerts/Notification when a given condition is met. Triggers should only be constructed by implementations of module:ct-alerts/TriggerService. The constructor takes a module:ct-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:ct-alerts/TriggerEvents).

Constructor

new module:ct-alerts/Trigger(properties)

Parameters:
Name Type Description
properties module:ct-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:ct-alerts/Notification.

Type
String

getState() → {module:ct-alerts/TriggerStates}

Returns:

The state that the trigger is currently in.

Type
module:ct-alerts/TriggerStates

getSubject() → {String}

Returns:

The subject of the instrument that this trigger is monitoring.

Type
String