I have a indicator that I've been working on and already received help on from here once. I'm trying to add a counter for breaches / crossing above a moving average. If the current bar is true I will receive a 1 on my counter otherwise it is always N/A and I'm not sure why. I believe my counter code is correct and I know the code returns 1 when true.
Code:
def bullEnd = crosses(high, upper, crossingdirection.above);
def crossCounter = if bullEnd == 1 then crossCounter[1] + 1 else crossCounter[1];
AddLabel(yes, crossCounter);