Jump to content

(REQ) Gann Trend Oscillator


Recommended Posts

Maybe someone would be kind enough to code it for you

 

Gann Swing Oscillator

Overview

The Gann Swing Oscillator has been adapted from Robert Krausz's book, "A W.D. Gann Treasure

Discovered".

The Gann Swing Oscillator helps define market swings. A market swing up is defined by 2 higher highs

while a market swing low is defined by 2 lower lows. An up-swing is indicated by a +1 value of the

oscillator while a down-swing is indicated by a -1 value.

Interpretation

The Gann Swing Oscillator is meant to be used in conjunction with the Gann HiLo Activator and Gann

Trend indicators to form a trading system methodology commonly referred to as the "New Gann Swing

Chartist Plan". Within this methodology the Gann Swing Oscillator is used to help determine market

direction for trading only with the current market trend.

{Market swing is defined as: Up = 2 higher highs, Down = 2 lower lows}

Us:= BarsSince(Sum(H>Ref(H,-1),2)=2);

Ds:= BarsSince(Sum(L<Ref(L,-1),2)=2);

Hc:= HighestSince(1,Us=0,H);

Lc:= LowestSince(1,Ds=0,L);

Sd1:= If(Us=0, If((L<>Lc) AND (Ref(L,-1)<>Lc), 1, 0), If(Ds=0, If((H<>HC) AND (Ref(H,-

1)<>Hc), -1, 0), 0));

Sd2:= If(Sd1=1,If(Ref(BarsSince(Sd1=1),-1) > Ref(BarsSince(Sd1=-1),-1), 1, 0), If(Sd1=-1,

If(Ref(BarsSince(Sd1=1),-1) < Ref(BarsSince(Sd1=-1),-1), -1, 0), 0));

TD1:= ValueWhen(1,Sd2<>0,Sd2);

 

Gann Trend Oscillator

Overview

The Gann Trend Oscillator has been adapted from Robert Krausz's book, "A W.D. Gann Treasure

Discovered".

The Gann Trend Oscillator helps define overall market trend direction. An up-trending market is

defined by a +1 value of the oscillator while a down-trending market is indicated by a -1 value.

Interpretation

The Gann Trend Oscillator is meant to be used in conjunction with the Gann HiLo Activator and Gann

Swing indicators to form a trading system methodology commonly referred to as the "New Gann

Swing Chartist Plan". Within this methodology the Gann Trend Oscillator is used to determine the

overall trend direction of the market.

{Market swing is defined as: Up = 2 higher highs, Down = 2 lower lows}

Us:= BarsSince(Sum(H>Ref(H,-1),2)=2);

Ds:= BarsSince(Sum(L<Ref(L,-1),2)=2);

Hc:= HighestSince(1,Us=0,H);

Lc:= LowestSince(1,Ds=0,L);

Sd1:= If(Us=0, If((L<>Lc) AND (Ref(L,-1)<>Lc), 1, 0), If(Ds=0, If((H<>HC) AND (Ref(H,-

1)<>Hc), -1, 0), 0));

Sd2:= If(Sd1=1,If(Ref(BarsSince(Sd1=1),-1) > Ref(BarsSince(Sd1=-1),-1), 1, 0), If(Sd1=-1,

If(Ref(BarsSince(Sd1=1),-1) < Ref(BarsSince(Sd1=-1),-1), -1, 0), 0));

TD1:= ValueWhen(1,Sd2<>0,Sd2);

{Swing Direction}

Sd:= TD1;

{Swing Change High}

Sch:= If(Sd=1 AND Ref(sd,-1)=-1, 1, 0);

{Swing Change Low}

Scl:= If(Sd=-1 AND Ref(Sd,-1)=1, 1, 0);

{Peak Value}

Pv:= If(Scl=1, HighestSince(1,Sch=1,H), 0);

{Trough Value}

Tv:= If(Sch=1, LowestSince(1,Scl=1,L), 0);

{Trend Direction}

Td:= If(H>ValueWhen(1,Pv>0,Pv), 1, If(L<ValueWhen(1,Tv>0,Tv), -1, 0));

{UpTrend=1 | DownTrend =-1}

Tdv:= ValueWhen(1,Td<>0,Td);

Edited by dk1aussie
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...