1) valuewhen ( Nth, EXPRESSION, DATA ARRAY )
2) barssince( DATA ARRAY )
valuewhen ( Nth, EXPRESSION, DATA ARRAY )
FUNCTION
Returns the value of the DATA ARRAY when the EXPRESSION was true on the Nth most recent occurrence. This includes all data loaded in the chart.
EXAMPLE
The formula "valuewhen( 2, cross(c,mov(c,10,s), rsi(20) )" returns the value of the RSI on the 2nd most recent occurrence of the closing price crossing above its 10-day moving average.
barssince( DATA ARRAY )
FUNCTION
Calculates the number of bars (time periods) that have passed since DATA ARRAY was true.
Important: When using the barssince() function in an exploration, you must click the "Load ___ Records" button in the Exploration Options dialog and specify a value equal to the number of bars loaded in your chart; otherwise, the exploration results may not be accurate.
EXAMPLE
barssince( macd() < 0 )
THX ~
Comment