In the following link, https://www.optuma.com/videos/gann-swings-part-2/ was a talk by Mathew VERDOUW in relation to gann swing testing, however due to technical issues with the swingend function, it can’t be used reliably for the purpose of testing gann swing patterns. So in trying to find a solution with What is available out there and myself are formulae’s for finding the pattern but before its complete. So the pattern in the video has 3 lower swing tops and generates a buy when it crosses the lowest swing high.
However it can not reference the immediate swing low before crossing above the swing high so it finds all such occurrences whether it happens after a higher swing low, or a lower swing low. So the closest solution is using gannswings in the formulae but the closest I can get to the pattern is that it finds the pattern the moment the 3 lower tops occur and then after that the swing turns up. So in my formulae (1) which is below, it only finds the occurences when their is a higher swing bottom.
Problem is of course is that the swing up when generated may not also cross above the swing high, before turning down. Because it does not cross the previous swing high during that same upswing it means the pattern did not actually eventuate.
So I have another formulae that indicates when a swing high is crossed after the forming of a new swing low(irrespective of whether it was higher swing low bottom or a lower swing low bottom) Now of course I can set up watchlists and scanners to find either condition but what I want, is to be able to use the BACKTESTER for testing gann swing patterns.
So in the attached picture and workbook the GREEN ‘higher bottom buy after 2 lower tops’ lines finds the potential pattern at the point of the swing turning up off a higher swing bottom.
The RED lines ‘high crosses above previous swing high’ find the basic pattern of a swing higher being crossed.
Now in reality what I would want to be able to do is identify when the green bar formulae occurs and then when the red bar formulae occurs during the same upswing, then and only then would the pattern be complete and usable for the purpose of testing.
So in the end is their a way to combine the 2 formulae in some way so that I can use it in the backtester so it only finds the completed patterns for the purpose of entry. I have had no luck myself hence the forum request.
In the attached picture it is a daily chart of commonwealth bank(CBA) on the Australian market. Overlaid is a 2 bar gann swing using outside bar and inside bar options. The red arrows are the same formulae as the bottom red bars, I though it would make it easier to see. So looking at the picture the completed pattern would only occur when the bottom new tool green bar and bottom new tool red bar align with each other. Below are the 2 formulae as well. I have also attached a workbook if that helps.
formulae 1 - higher bottom buy after 2 lower tops
GS1 = GANNSWING(SWINGCOUNT=2, USEINSIDE=True, METHOD=Use Outside Bar, USECLUSTERS=False); SWINGUP(GS1) and (SWINGSTART(GS1) < SWINGSTART(GS1, 1))and (SWINGSTART(GS1, 1) < SWINGSTART(GS1, 3)) and SWINGSTART(gs1) > SWINGSTART(gs1, 2) and (SWINGSTART(GS1, 3) < SWINGSTART(GS1, 5)) and SWINGSTART(gs1,2) < SWINGSTART(gs1, 4)
Formulae 2 High crosses above previous swing high
g1 = GANNSWING(SWINGCOUNT=2, USECLUSTERS=False, USEINSIDE=True, METHOD=Use Outside Bar) ;
s1 = SWINGEND(g1[1]);
U1 = SWINGUP(g1);
V1 = IF(S1 < SWINGEND(g1[2]),SWINGEND(g1[2]),S1) ;
high() CrossesAbove V1 and U1 == 1
cba-gann-swing.owb (19.3 KB)