July 27, 2021 at 3:18 pm #65359
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.
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?August 5, 2021 at 8:56 pm #65423Tim
- Topics: 11
- Replies: 19
- Posts: 30
Hi lester, I can help you with the script but can you do a picutre up for me describing what you want.August 5, 2021 at 10:49 pm #65425
You can see the ideas by clicking on the link CBA-daily-entry-on -a weekly-gann-swing.owb.August 6, 2021 at 2:11 am #65427
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);
A1= S3 < s1 and u1;
Create another code for swing 0 as swing down
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 helpAugust 6, 2021 at 11:50 am #65433Tim
- Topics: 11
- Replies: 19
- Posts: 30
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.August 7, 2021 at 5:01 pm #65463
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.1234567891011121314151617//GS Daily with Weekly TFg1 = GANNSWING(Week(PERIODAMOUNT=1, BARBYBAR=False),SWINGCOUNT=1, METHOD=Use Next Bar, USEINSIDE=True, USEBREAKOUT=False);s1 = SWINGEND(g1);U1 = SWINGUP(g1);V1 = IF(S1 < SWINGEND(g1),SWINGEND(g1),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).123GANNSWING(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.123e.g. SWINGEND(SWINGEND(Week(PERIODAMOUNT=1), g1)
Hope this helps.
Cheers, LesterAugust 9, 2021 at 11:59 am #65491
I have found a reference for a Weekly Swing on Daily Chart in the Optuma knowledge base.
(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, LesterAugust 11, 2021 at 9:56 pm #65533
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;August 12, 2021 at 4:46 pm #65549
You are correct. I did not include a condition of a higher trough following the previous trough. Changing the Show Bar Script fixes it.123456789101112131415g1 = GANNSWING(Week(PERIODAMOUNT=1, BARBYBAR=False),SWINGCOUNT=1, METHOD=Use Next Bar, USEINSIDE=True, USEBREAKOUT=False);s1 = SWINGEND(g1);U1 = SWINGUP(g1);c1 = SWINGEND(g1) > SWINGEND(g1);V1 = IF(S1 < SWINGEND(g1),SWINGEND(g1),S1) ;s2= high() CrossesAbove V1 and U1 == 1 and c1;s2
- You must be logged in to reply to this topic.