My apologies I altered a couple of things and forgot to fully fix up, see below, naturally you can alter the GS1 swing parameters to suit. It shows the completed triangle, but there are as always some anomolies. There are different scripts if your looking for triangles forming but not yet confirmed, I have pasted also below a script that finds patterns where the swing turns up to create the possible triangle but may not yet have closed above the swing top to confirm a triangle, It would be more a script to use in scanning looking for potential triangle candidates
GS1 = GANNSWING(SWINGCOUNT=2, USEINSIDE=True, METHOD=Use Next Bar, USECLUSTERS=False);
c1 = SWINGUP(GS1);
c2 = SWINGSTART(GS1) < SWINGSTART(GS1, 1);
c3 = SWINGSTART(GS1, 1) < SWINGSTART(GS1, 3);
c4 = SWINGSTART(GS1) > SWINGSTART(GS1, 2);
c5 = SWINGSTART(GS1, 2) > SWINGSTART(GS1, 4);
s1 = SWINGEND(GS1[1]);
U1 = SWINGUP(GS1);
V1 = IF(S1 < SWINGEND(GS1[2]),SWINGEND(GS1[2]),S1);
c6 = high() CrossesAbove V1 and U1 == 1;
c1 and c2 and c3 and c4 and c5 and c6
//Gann swing triangle canditates//
GS1 = GANNSWING();
SWINGUP(GS1) and (SWINGSTART(GS1) > SWINGSTART(GS1, 2))
and (SWINGSTART(GS1, 2) > SWINGSTART(GS1, 4))
and (SWINGSTART(GS1, 1) < SWINGSTART(GS1, 3))