A Trigger Indicator

Here’s a handy indicator (called Trigger) some of you might be able to use sometime, because it can remember previous values. It is designed so that some trigger condition stores a time series value that is remembered and is the output of the indicator until the next time the trigger is “pulled”. The indicator takes two parameters:

1. A trigger condition, into which you will feed an indicator like A>B
2. A time series whose value you want to remember when the trigger condition is true (non-zero)
3. The initial value of the indicator before any trigger condition is true, which can be either a constant or another time series

Example 1. For example, lets say you want your indicator to reflect the last closing price when the RSI was above 70. Until the first time the RSI is above 70, you want your indicator to be equal to 0.

Here is how you would call Trigger:
Trigger
Condition: >(RSI,70)
Time Series: Close
Initial Value: 0

Example 2. As another example, suppose you want to remember the CCI Indicator on the last day when the close exceeded the open by 3 points. Until the first time the close is greater then the open + 3, you want your indicator to be equal to the Low.

Here is how you would call Trigger:
Trigger
Condition: >(Close,Add2(Open,3))
Time Series: CCI
Initial Value: Low

Note: in the examples above we have eliminated the parameters of the RSI and CCI indicators for clarity.

Click here to download the Trigger indicator. Place both the .tpl file and the .dll file in the Template Folder.

Was this article helpful?

Related Articles