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
g1 = GANNSWING(WEEK(BARBYBAR=True),METHOD=Use Next Bar, USEINSIDE=True);
e1 = SWINGEND(g1);
c1 = Low() CrossesBelow e1[1];
c2 = e1[2] > e1[1];//THIS IS TO GIVE DIRECTION
s2 = c1 and c2;
s2
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