Gann Swing Script does not work with CrossesAbove

Hi,

The following Show Bar script does not work in all situations.

g1 = GANNSWING(METHOD=Use Next Bar);

d1 = SWINGEND(g1);

c1 = HIGH() CrossesAbove d1[1];

c2 = d1[1] > d1[0];

c3 = d1[0] > d1[2];

c1 and c2 and c3

The attached WS in Training Mode Shows where it has not worked. It does work if “CrossesAbove” is changed to “>”.

Is there a trick to this?

Cheers, Lester

 

 

Gann-Swing-Demo-Cleaned.owb (13.4 KB)

I believe this may be because “Crosses” includes “equal to”.

By that I mean that if the point is hit but not crossed above, it still registers as “crossesabove”.

That would be why > works. You would need to code “was below and is now above” to avoid this problem.

cheers

Hi Michael,

Thank you for your reply. You are correct.

I assumed this is the sort of script you mean.

c1 = HIGH() > d1[1] and HIGH(OFFSET=1) < d1[1];

It seems to work correctly now.

Cheers, Lester

That’s exactly it.

I believe that is what “crossesabove” should actually do.

I hope my friends at Optuma read this and decide to change the logic. It had caused me much dismay until I figured out that “crossesabove” does not actually mean above.

Ah yes, I spotted that a couple of months ago too. The “crosses” operators have been updated in Optuma 1.6 not to trigger on an equals. Beta due within the next week.

Hi Mathew,

Thank you for the update on this fix.

Cheers, Lester