Guest User | Sign In

Knowledge Base

VALUEWHEN() Function

The VALUEWHEN function can be used to calculate the price (OHLC) or indicator value when a certain technical condition occurs.

For example, to find out the closing price of a stock when the 50MA last crossed below the 200MA:

V1 = MA(BARS=50, CALC=Close) CrossesBelow MA(BARS=200, CALC=Close);
VALUEWHEN(V1)


To find the high price on the day of the cross:

V1 = MA(BARS=50, CALC=Close) CrossesBelow MA(BARS=200, CALC=Close);
VALUEWHEN(HIGH(), V1)


To find the value of the MA50 when they crossed:

V1 = MA(BARS=50, CALC=Close) CrossesBelow MA(BARS=200, CALC=Close);
VALUEWHEN(MA(BARS=50, CALC=Close), V1)


To find the RSI(14) value when they crossed:

V1 = MA(BARS=50, CALC=Close) CrossesBelow MA(BARS=200, CALC=Close);
VALUEWHEN(RSI(BARS=14), V1)


To find the value of the last pivot high:

VALUEWHEN(HIGH(),PIVOT(MIN=10, TYPE=High))

 Last updated Tue, Dec 11 2018 12:46am

Please Wait!

Please wait... it will take a second!