# Gann Swing END Labels

Could someone familiar with use of the Gann Swing Script please check out the following.

As an aid to scripting with GS Ends I have made the attached diagram. Please tell me if I am correct?

I have also found variation if between these two ways of scripting.

c1 = CLOSE() > e1[1] and CLOSE(OFFSET=1) < e1[1];

OR

c1 =close() CrossesAbove e1[1];

Thanks, in anticipation,

Lester

GANN-SWING-END-LABLES-IN-OPTUMA.pdf (27.2 KB)

Hi Lester,

See Mathew’s detailed reply here which might help, particularly around SwingList vs BarList values when scripting for swings ends and starts:

Hi Darren,
Thank you for your reply, I am aware of Mathews’s explanation. What I wish is conformation of my diagram that I have the correct visual image of how each swing is labeled then processed.

Regards, Lester

Hi Lester,

Can you please provide the full formula as I’m not sure what e1 is referring to. Be sure to use the <>Code button above when pasting the formula.

Also, note that the offset to use will depend on the direction of the current swing. For example, if the current swing is up you need to look two swings ago for the prior high as the previous swing end would be the low.

Attached is a workbook with the following watchlist which labels the previous swings. Basically, when the swing is up the previous swing highs are even offsets [2], [4], etc and the lows are odd ie [1], [3]. When the swing is down then the opposite is true.

Is this example of a 2 bar swing (set to use Next Bar and include Inside Bars) XEJ is in an upswing, so the previous swing end GS[1] is the low at 7996, whereas XDJ GS[1] is the high of 3193.

Save and open the workbook to get the formulas for swing end values in this watchlist, eg:

```GS1 = GANNSWING(SWINGCOUNT=2, USEINSIDE=True, METHOD=Use Next Bar);
SWINGEND(GS1)[1]```

SwingEnd-Values.owb (47.4 KB)

```Hi Darren,

With regard to the other part of my question the rest of the code is based on Mathews post https://www.optuma.com/videos/gann-swings-part-2/

I had something similar to this.  Note the line //c1 = CLOSE(OFFSET=1) < e1[1] and CLOSE() > e1[1];

```
```//Gann Swing Trend Up U1
g1 = GANNSWING(SWINGCOUNT=1, METHOD=Use Next Bar, USEINSIDE=True);
e1 = SWINGEND(g1);
c1 = CLOSE() CrossesAbove e1[1]; //c1 = CLOSE(OFFSET=1) < e1[1] and CLOSE() > e1[1];
//c1 = CLOSE(OFFSET=1) < e1[1] and CLOSE() > e1[1];
c2 = e1[2] < e1[1];
c3 = (e1[5] > e1[3]) and (e1[3] > e1[1]);
c4 = c1 and c2 and c3;
c4```
```Cheers, Lester
ps I tried using the "code" format button, but it did not seem to work correctly for me!  Sorry.```