Identifying Gaps on Gann Swing Charts

Hi,

On a Gann Swing Chart, I’d like to be able identify gaps in the swing, such as the one pictured below. These sort of gaps often, but not always, indicate a change of trend or strengthening of a trend.

In the first example attached, there was an initial slow and steady uptrend (a few higher swing highs and higher swing lows), then after the gap, the uptrend accelerated. The gap can be an early clue that sentiment has shifted. The swing down that created the gap was < 50%, which can be another clue as to strength.
A second example is also attached.

I’ve looked at the GANNSWING() function and the inbuilt scripts, Gann Swing Bull Gap Greater and Gann Swing Bull Gap Less but they don’t seem to be written to identify gaps.
Not sure where to start with this but hopefully someone can help.

Thanks.

Hi Ian,

The first thing I always do with Swings is draw out the pattern I am interested in and then number the swings. Remember that it is not until the last swing turns up that we will have our signal, so that is where we expect to see the arrow. In the image below I have my numbers just to the left of each line.

swings

Also, remember that we can reference previous swings by using square brackets. If there are no square brackets, I am working with the last swing line (0). I use the variables “g1” to make the script easier to read.

Given that, the code will be

// add the swing to the variable g1 
g1 = GANNSWING(SWINGCOUNT=2, USEINSIDE=True); 
// is swing line 0 up 
c1 = SwingEnd(g1) > SwingStart(g1); 
// is the start of swing 0 higher than the start of swing 3 
c2 = SwingStart(g1) > SwingStart(g1[3]); 

c1 and c2

Hope that helps

Mathew

Hi Ian, below is a script, if you tell me what your after I can give you a bit of a hand even though my scripting skills are poor

GS1 = GANNSWING(SWINGCOUNT=1, USEINSIDE=True, METHOD=Use Outside Bar, USECLUSTERS=True);

c1 = SWINGUP(GS1);
c2 = SWINGSTART(GS1) < SWINGSTART(GS1, 1);
c3 = SWINGSTART(GS1, 1) > SWINGSTART(GS1, 3);
c4 = SWINGSTART(gs1) > SWINGSTART(gs1,3);

s1 = SWINGEND(GS1[1]);
U1 = SWINGUP(GS1);
V1 = IF(S1 < SWINGEND(GS1[2]),SWINGEND(GS1[2]),S1) ;

c7 = high() CrossesAbove V1 and U1 == 1;

c1 and c2 and c3 and c4 and c7

Thanks for your replies.

Mathew, your tip on numbering the swings seems obvious when you point it out!

I tested the script on a small workbook in which there were 4 known Swing gaps, and this identified all 4. Results varied depending on whether SWINGCOUNT = 1 or SWINGCOUNT = 2 was used.

Tim, your script identified 2 of the 4 gaps, but I haven’t yet delved into it to see what might need changing.