krazymatty
New member
The ATR is a constantly changing value. What I want to do is set a Variable = ATR and not change until a MA Cross happens.
I don't want my Plots that use the ATR Value in their expression to change until a MA Cross Event.
Example:
My issue is when the event isn't triggered the ATR is never initially set.
I don't want my Plots that use the ATR Value in their expression to change until a MA Cross Event.
Example:
Code:
def ATR;
if fastEMA > slowEMA and fastEMA[1] <= slowEMA[1] then {
ATR = MovingAverage(AverageType.WILDERS, TrueRange(high, close, low), 14);
} else {
ATR = ATR[1]
}
My issue is when the event isn't triggered the ATR is never initially set.