Any expression that contains a

comparison operator will resolve to a boolean YES or NO value. YES and NO are basically just placeholders for 1 and 0 respectively. Sum(), the way we're using it here, is adding up all the 1's and 0's over a length of bars. Its just counting the number of times that the condition is true.

This means that the number of times

X is greater than Y,

over three bars, is

equal to 3.

**Sum( X>Y, 3) == 3;**
It could also be written as:

X > Y and X[1] > Y[1] and X[2] > Y[2]

If you only need the

condition to met at least once, you would want the total to be

greater than or equal to 1.

Sum(

X>Y,3)

>= 1;

This could also be written as:

X > Y OR X[1] > Y[1] OR X[2] > Y[2]

Def ReqMgapup = sum(close > open, 3) == 3 and low > high[2]

__ - 1;__
I don't actually know why you put the -1 there, I was going to ask you the same thing.

Once you introduce an

offset to the condition, you may or may not want to

reduce the length.

It depends on your preference or intention.

Sum(X>Y

[1], 3) == 3;

X > Y[1] and X[1] > Y[2] and X[2] >

Y[3]
Sum(X>Y

[1],

2)

== 2;

X > Y[1] and X[1] > Y[2]

The top version incorporates bars 0, 1, 2, and

3, which is four bars, but only sort of.

The bottom version incorporates only bars 0, 1, and 2.

I'm heading out now though, I'll take another look later tonight.