I am not getting consistent behavior with the cross method. Explanation follows.
I need to generate a signal when price crosses the upper regression channel. my code looks like this:
double shortLine = RegressionChannel(50, 3.5).Upper[0]; if (CrossAbove(High, shortLine, 1)) { ShortSignal.Set(shortLine); }
Are there cases you can think of that the CrossAbove will return false even though price does "cross" the channel?
In order for the cross to return true, does price need to be greater than the channel or is it enough for it to be equal?
On a gap, will the CrossAbove return true or does price need to run through the channel for it to return true?
I have the CalculateOnBarClose set to false. Does it make a difference if I am using the High or the Close in order to determine a cross over?
In the call to CrossAbove, the "1" value means that the high of the previous bar has to be lower than the channel and the high of the current bar needs to be higher than the upper channel - right?
Since the regression channel 1 bar back is moving, could it be that this is what is messing things up for me?
Hope all this makes sense.
Onn
Comment