Gann Swing with different Time Frames

Hi,

I wish to write Daily Time Frame script that will trigger based on an overlayed Weekly Time Frame Gann Swing.

The setup for a trigger point is when a Weekly GS Low is followed another Higher GS Low.

The final trigger is when the Daily High crosses above the subsequent Weekly GS High.

Please see the attached Work Sheet.

Cheers, Lester

PS I assume the trigger script will be similar to the one listed at https://www.optuma.com/videos/gann-swings-part-2/ but will have an appropriate Time Frame tweak?

CBA-Daily-Entry-on-a-Weekly-Gann-Swing.owb (16 KB)

Hi lester, I can help you with the script but can you do a picutre up for me describing what you want.

Hi Tim
You can see the ideas by clicking on the link CBA-daily-entry-on -a weekly-gann-swing.owb.

Hi Lester

I am new to scripting .

My approach would be to assigned gannswing(Gs1) as weekly and gannswing (GS2) as daily

Then write a condition for higher low .
// Higher low with swing 0 as up
GS1 =GANNSWING(WEEK(Week(PERIODAMOUNT=1))SWINGCOUNT=2, USEINSIDE=False, DEFAULT=SwingList, METHOD=Use Next Bar, USECLUSTERS=False, USEBREAKOUT=False);

U1 =swingup(GS1);
E0=SWINGEND(GS1);
S1=OFFSET(E0,OFFSET=1);
S2=OFFSET( E0,OFFSET=2);
S3=OFFSET(E0,OFFSET=3);
s4 =OFFSET(E0,OFFSET=4);
S5=OFFSET(E0,OFFSET=5);

A1= S3 < s1 and u1;
Create another code for swing 0 as swing down
A2= s4<s2;
In the forum search for “ Help with gann swing pattern solution please”.
And change the code GS1 to GS2 as below .

GS2 =GANNSWING(DAY(Day(PERIODAMOUNT=1))SWINGCOUNT=2, USEINSIDE=False, DEFAULT=SwingList, METHOD=Use Next Bar, USECLUSTERS=False, USEBREAKOUT=False);

And on the last line I would add in condition A1

“C8=c1 and c2 and c3 and c4 and c5 and c6 and c7 and A1”

Hope this help

I don’t think it can be done the way you want at least with my skill level is because - When looking at higher time frames on a daily chart the higher time frame won’t actually be triggered until the end of the period, ie Friday on a weekly chart.

I have attached a picture of the same period as your workbook, the red overlay line is the weekly swing, you will see the green arrow that i have the information box attached to is Thursday 1 April, which is the last trading day for the week, so even though the previous bar actually triggered the weekly swing to turn up on a price basis the week was not completed till the following day. You will see that the other green arrows also correspond with the last trading day of the week. The formula was simply gannswing(week())turnsup This is because optuma does not use bar by bar option on swings, so even on a daily chart it does not see the weekly anything until the last day of the week.

Hi, Tim & Cuong

Thank you Tim and Cuong for your interest and contributions.

I have done some more work and found a script that partly works. My included Work Sheet (GS DW Eg) shows correct and incorrect triggers.

//GS Daily with Weekly TF

g1 = GANNSWING(Week(PERIODAMOUNT=1, BARBYBAR=False),SWINGCOUNT=1, METHOD=Use Next Bar, USEINSIDE=True, USEBREAKOUT=False);

s1 = SWINGEND(g1[1]);

U1 = SWINGUP(g1);

 

V1 = IF(S1 < SWINGEND(g1[2]),SWINGEND(g1[2]),S1) ;

s2= high() CrossesAbove V1 and U1 == 1;

s2

I did try it with the BARBYBAR=True option, but that caused multiple triggering.

Originally, I was misled when I placed a Gann Swing Weekly Overlay on the Daily Chart.

I used the following script in a Show Plot. Initially it seems to work, but on closer examination turning points were occurring during the week (Which IS INCORRECT).

GANNSWING(WEEK(), METHOD=Use Next Bar)

I would like to be able to add a GS Weekly TF Overlay onto the Daily chart, but have not yet found a way to do it.

In my script that partly works above you will note that the “Week(PERIODAMOUNT=1, BARBYBAR=False)” TF override is placed inside the GANNSWING() operator.

This is contrary to what the Optuma “Word Processor Syntax Editor Tool” wants. If used correctly only want a TF override to be placed in a GS sub-function.

e.g. SWINGEND(SWINGEND(Week(PERIODAMOUNT=1), g1[1])

Hope this helps.

Cheers, Lester

GS-DW-Eg.owb (25.3 KB)

Good Morning,
I have found a reference for a Weekly Swing on Daily Chart in the Optuma knowledge base.

https://help.optuma.com/kb/faq.php?id=924
(at the bottom of the page)

It shows an example using “GannSwing(Week())” placed on a chart with the Show Plot function.

But some of the GS swings happen mid-week?

Is there something that I am missing here?

Cheers, Lester

Hi Lester

All the false triggers are actually valid for V1 condition. So I do believe you will needs to work out further conditions to remove those false trigger.
Tried replacing the high() to a close(). To me ,a closing price above previous high is a stronger indication that price could move higher.(looking at weekly chart)

s2= high() CrossesAbove V1 and U1 == 1;

Hi Cuong

You are correct. I did not include a condition of a higher trough following the previous trough. Changing the Show Bar Script fixes it.

g1 = GANNSWING(Week(PERIODAMOUNT=1, BARBYBAR=False),SWINGCOUNT=1, METHOD=Use Next Bar, USEINSIDE=True, USEBREAKOUT=False);

s1 = SWINGEND(g1[1]);

U1 = SWINGUP(g1);

c1 = SWINGEND(g1[1]) > SWINGEND(g1[3]);

V1 = IF(S1 < SWINGEND(g1[2]),SWINGEND(g1[2]),S1) ;

s2= high() CrossesAbove V1 and U1 == 1 and c1;

s2

Cheers, Lester