CHANGESINCESIGNAL() Function

Author: Optuma Team Last updated: Oct 10, 2018 01:57

The CHANGESINCESIGNAL() function displays the change in price (percentage by default, but can be changed to price) since a triggered signal (which needs to be a true/false Boolean script).

For example, this script will calculate the price change since the last break of the 22 day lowest low, as defined by Signal1:

Signal1 = LOW() < LOWESTLOW(BARS=22);  
CHANGESINCESIGNAL(Signal1)

MRK having changed 32.1% since the 22 day low (red dashed line) was lower on April 3rd:

Capture

Another example, uses the percentage change and will display a result when that value increases by more than 2% (between two bars)

Signal1 = LOW() < LOWESTLOW();  
PercentChange1 = CHANGESINCESIGNAL(Signal1);  

// find out when the change increases by 2% than the previous percentage change
PercentChange1 - PercentChange1[1] >= 2

On the chart it would looks like this (green highlighted section):

CSS2