Guest User | Sign In

Knowledge Base

TimeSinceSignal Function

This function allows you to display the number of bars / days / weeks / months or years since a specified true condition has been met. For example this formula counts the number of trading days since the close was below the 200 day moving average:

//Define the true condition in variable V1
V1 = CLOSE() < MA(CALC=Close, BARS=200);
//Calculate time since V1 was true
TIMESINCESIGNAL(V1)


In this example, Visa hasn't closed below its 200 day MA in 457 trading days:



Note: the Show View is using Dot as the Plot Style



To find a new high that occurred X days ago


This formula finds new 52 week highs that occurred 3 days ago:

V1 = HIGH() > HIGHESTHIGH(RANGE=Look Back Period, BACKTYPE=Weeks, BARS=52);
TIMESINCESIGNAL(V1) == 3


For new all-time highs that occurred within the last 5 days:

V1 = HIGH() >= HIGHESTHIGH(RANGE=All Time);
TIMESINCESIGNAL(V1) <= 5

 Last updated Fri, Oct 26 2018 12:26am

Please Wait!

Please wait... it will take a second!