Gann Swing Exit Refinement

Hi Forum,

Here is an opportunity to prove you are a Master in scripting Gann Swing AND also find a good GS exit script.

I wish to use a Gann Swing Exit to occur with a Stop Loss (I.E. on Signal). Here is a script that works very well in backtesting.

//WW Gann Swing Trend Down D1


e1 = SWINGEND(g1);

c1 = Low() CrossesBelow e1[1];

c2 = e1[2] > e1[1];//THIS IS TO GIVE DIRECTION

s2 = c1 and c2;


My problem script is the real-time implementation of this exit:

It does not work the way I originally thought. My original idea was to exit when the Low crossed under the last Gann Swing Trough.

However, that is not the way it works, which is just as well because NOT taking an exit every time the Low crosses under the last Gann Swing Trough makes it way more profitable.

I added condition c2 to give the script a way to orientate the direction of the last Gann Swing (i.e. downwards for an exit). What is also surprising is that adding c2 as a Show Bar occurs on every Gann Swing Peak, so why does “c1 AND c2” cause a Show Bar only for some exits?

Can anyone please explain. I should also add that Matthew Humphreys has already confirmed my correct labeling of Gann Swing Peaks and Troughs in the Scripting post titled “What is Correct Labeling of Gann Swing??”


Regards, Lester

Just added latest version of Work Book

FMG-GS-Ex-1-1.owb (14.8 KB)

Hi Lester,

As I understand the Gann Swing, the fact that the swing has turn down, as in you case, can take more than one bar following the top to confirm the “top” is a top and that the has turned swing down.



Hi Trevor,

Again thank very much for your reply. I assume it is all tired up with the algorithm Optuma uses to identify peaks. It is still a good exit though, even if used on “next day” (as it is weekly that means next week). Although it is a bit like flying blind! Not a comfortable feeling.

I just have to be mindful if the algorithm gets changed in future updates.

Regards, Lester