if(revToLong == true && High[0] >= Highs[0][0]+ 0.04)
The primary series is a range bar and the secondary series is a 1 tick bar. Overall, the strategy has been doing what it's supposed to, with a glitch once in a while. What the code is doing is effecting a block (with the entry orders) to execute when the High[0] (the tick series) is above or equal to the high of the most recently completed primary series bar plus 0.04.
Here is what the chart looks like:
The point at the blue arrow shows a previous stop out, but it is also 4 ticks above the high of the prior bar.
If I use this code:
if(revToLong == true && High[0] >= Highs[0][0]+ 0.0399999)
or this:
if(revToLong == true && High[0] + 0.00001 >= Highs[0][0]+ 0.04)
Then the chart looks correct like this...
It seems like somehow the values in the data series are not evaluating at exactly what they should. I also noticed that by playing with the fudge factors in the two lines of code above, it can make my reversals plot correctly, even though the fudge factors are several decimal places smaller than the tick increment of the instrument.
Any idea what's going on and how to resolve?
Thanks.

Comment