get_value
Syntax Format
get_value(x[, default])
Overview
The get_value function returns the value of x at the current bar or default value, if x does not have the current value. This function is helpful in case you need to use the series as a condition for the if statement.
Parameters
| Parameter | Type | Purpose | 
|---|---|---|
| x | series | Input value, taken into calculation | 
| default | series | Optional default value | 
Returns: the same type as x. If type of x is not series – x is returned, if x is not nil, default otherwise.
Example
uptrend = conditional (close > open)
if get_value(uptrend) then
    print("Going up")
end