What makes you think that you are changing the step size? From what I see,
you're still advancing a single bar at a time.
bigHigh = high >Ref (hhv(high,50),-1);
smallLow = low < Ref (llv(low,50),-1);
lookingForHigh = true;
for (bar = 0; bar < BarCount; bar++) {
if (lookingForHigh) {
if (bigHigh[bar]) {
lookingForHigh = false; // now looking for low
}
} else {
if (smallLow[bar]) {
lookingForHigh = true;
}
}
}
Mike
--- In [email protected], "Markus Witzler" <funny...@...> wrote:
>
> Hello,
>
> I wonder if I can step thru a loop where the step size is being computed
> WITHIN the loop.
>
> An example:
>
> I want the loop to check for every bar until high >Ref (hhv(high,50),-1).
>
> From THAT bar on, the loop should check if low < Ref (llv(low,50),-1) occured.
>
> Say, the first condition is true on bar 50, the loop should afterwards start
> to check for the second ccondition from bar 51 until that condition is
> fullfilled, say on bar 80.
>
> From THAT bar on, it again should check for the first condition etc.
>
> The thing is that I can“t tell the loop the step size in ADVANCE and it may
> differ over the whole data range, depending on WHEN the condition beign
> checked for is true.
>
> Any ideas on this?
>
> Thanks
>
> Markus
>