Currently writing an indicator and have ran into an issue I can't quite wrap my head around.
What this function is doing is checking to see from the bar that started the indicator (let's call it bar "30") until the current bar (let's call it bar "53"), which should be the next step of the indicator, has any bar in between bar 30 and bar 53 had a high that's over the current EMA(21).
What I expected to happen is if the high of the current bar is greater than the current EMA(21) then we return false because we do not want to continue; if it is not greater then we want to return true and continue with the indicator. But for some reason it's telling me that it can't get to the "return true;".
I am obviously missing something simple but not sure what...please help...
protected bool canContinue (int n) {
for (int i = n; i >= startLegNum; i--) {
if (High[i] > ema21[0]) {
return false;
}
return true;
}
}
Travis Sloneker

Comment