BullCharts Forum Homepage
Forum Home Forum Home > BullCharts > BullScript
  New Posts New Posts RSS Feed: Gann Square of 9 and 144
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Gann Square of 9 and 144

 Post Reply Post Reply
Author
Message / View First Unread Post
cmacdon View Drop Down
BullCharts Guru
BullCharts Guru


Joined: 09 Sep 2012
Location: Brisbane
Posts: 236
Post Options Post Options   Quote cmacdon Quote  Post ReplyReply Direct Link To This Post Topic: Gann Square of 9 and 144
    Posted: 09 Oct 2012 at 2:35pm
I came across a query in the Bullscan section of the Forum regarding Gann Squares which reminded me I had some code done a few years back after translating a description of a Gann Square of 9, to an ocillator conversion by Patrick Mikula.  The book reference is in the citation section of the code.
 
The Chart further below shows 3 indicators.  The original is my coding of Mikula's Overextended Indicator from Chapter 17 of the book.  The second indicator which is coded further below shows the bells and whistle colour fills and markers if price coses above or below the indicated 30, 60 ,90 or 120 degree lines.
 
Because the inidcator is based on square root calculations there is a Multiplier to be used in the input variables.  Very low priced stock might use a multiplier of 100 and mid range say 10 so the ocillator is properly scaled.
 
Mikula suggests markets are overextended when oscillator "moves +45, +90 or + 180 degrees above the moving average ... when this happens watch for a pivot reversal" and vice versa for -'ve 45,90 and 180 degrees.
 
The third indicator (bare codebelow) is not in Mikulas book buit is just converting the Square of 9 code to a Gann Square of 144.  As you will see the Square of 144 joscillator ust seems to be a longer trend oscillator compared to the short trends picked up by the square of 9.
 
 
BC User since June 2007
Back to Top
cmacdon View Drop Down
BullCharts Guru
BullCharts Guru


Joined: 09 Sep 2012
Location: Brisbane
Posts: 236
Post Options Post Options   Quote cmacdon Quote  Post ReplyReply Direct Link To This Post Posted: 09 Oct 2012 at 2:36pm
Code below switch on fills and markes in the style section.
 
 

[description

="CMD Adapted MIKULA SQ OF 9 Oscillator Description to Bullscript "]

[citation

="Patrick Mikula; The Definitive Guide to Forecasting using W.D.Gann's Square of Nine,Mikula Forecasting Library,2003"]

n1 :=

input("Price Multiplier",10,1);

[horzline

=180, 135,90,45,-45,-90,-135,-180];

prd:=

input("MA period",9,1);

step1:=

ma(C,prd,s);

step2:= n1*

c;

step3:= step1*n1;

step4:=

sqrt(step2);

step5:=

sqrt(step3);

step6:=step4-step5;

step7:=(step6*360)/2;

step8:=

ma(step7,2,s);

MsQ:=step8;

[name

=MikulaSqof9]

Msq;

a:=45;

b:=-45;

 

{ Fill }

[visible

=false]

[name

=Fill; linestyle=fill]

[color

=red] msq;

[color

=green] a;

[visible

=true]

{ Fill }

[visible

=false]

[name

=Fill; linestyle=fill]

[color

=red] msq;

[color

=green] b;

[visible

=true]

 

{ Markers Show crossing of the degree angles}

[visible

=false]

[name

=0; linestyle=marker; marker=buy; tooltip=" SQ9"]

[color

=green]

cross

(msq,0);

[name

=60; linestyle=marker; marker=buy; tooltip=" SQ9"]

[color

=lime green]

cross

(msq,-60);

[name

=90; linestyle=marker; marker=buy; tooltip=" SQ9"]

[color

=lime green]

cross

(msq,-90);

[name

=120; linestyle=marker; marker=buy; tooltip=" SQ9"]

[color

=lime green]

cross

(msq,-120);

[name

=0; linestyle=marker; marker=sell; tooltip=" SQ9"]

[color

=Red]

cross

(0,msq);

[name

=30; linestyle=marker; marker=sell; tooltip=" SQ9"]

[color

=Orange]

cross

(30,msq);

[name

=60; linestyle=marker; marker=sell; tooltip=" SQ9"]

[color

=Orange]

cross

(60,msq);

[name

=90; linestyle=marker; marker=sell; tooltip=" SQ9"]

[color

=Orange]

cross

(90,msq);

[name

=120; linestyle=marker; marker=sell; tooltip=" SQ9"]

[color

=Orange]

cross

(120,msq);

BC User since June 2007
Back to Top
cmacdon View Drop Down
BullCharts Guru
BullCharts Guru


Joined: 09 Sep 2012
Location: Brisbane
Posts: 236
Post Options Post Options   Quote cmacdon Quote  Post ReplyReply Direct Link To This Post Posted: 09 Oct 2012 at 2:38pm
Bare Bones Square of 144 ocillator.
 

[description

="CMD Adapted MIKULA SQ OF 9 Oscillator to reflect a Gann SQ OF 144"]

[citation

="Patrick Mikula; The Definitive Guide to Forecasting using W.D.Gann's Square of Nine,Mikula Forecasting Library,2003"]

 

n1 :=

input("Price Multiplier",10,1);

[horzline

=90,45,-45,-90];

prd:=

input("MA period",144,1);

step1:=

ma(C,prd,s);

step2:= n1*

c;

step3:= step1*n1;

step4:=

sqrt(step2);

step5:=

sqrt(step3);

step6:=step4-step5;

step7:=(step6*360)/2;

step8:=

ma(step7,2,s);

MsQ:=step8;

[name

=MikulaSqof144]

Msq;

BC User since June 2007
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.69
Copyright ©2001-2010 Web Wiz