PercentR Crossing Moving Average Signal Not Working

ncallie301

New member
Joined
Apr 13, 2021
Posts
4
Likes
0
I created a PercentR Function which I have validated. I created a Study that should return a Signal on Bars in which PercentR crosses it's own Exponential Moving Average (PREMA).

Java:
if (crossedAbove(series, index - i, Values.PERCENTR, Values.PREMA)) {
        ruleOne = true;
        break;
}

This is instead returning a signal for every bar where PercentR is above it's EMA, instead of only when it crosses above that EMA.
 

Spin

Well-known member
Joined
May 22, 2019
Posts
480
Likes
192
Hmmm, strange behavior indeed. :unsure:

Did you try adding debug statements to see what Values are being used by the Study to decide whether a crossAbove took place or not ?

That would be my next move
 
Top