[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gann swings Indicator



PureBytes Links

Trading Reference Links

At 02:09 PM 10/5/99 -0700, you wrote:
>Would anyone have an Indicator that would replicate the charts seen in the
>Gann Article in the October TASC?   I would like to replicate the red and
>green swing/trend lines drawn between the swing highs and lows.
>
>Many thanks
>
>Philip
>

Philip - here is what I wrote based on the article. I plot the swings
(plot1) as a line and the trend I mark with large dots of diff. colors
at the hi/low of each bar (plot2&3). Like most all swing code this
sometimes is a little flaky, and also TS does not always update the
offset lines in realtime. 

rich



{indicator 'gann swings' 
see p.37 , oct.99 tasc "Gann Swings and Intraday Trading"
setup:  plot1 as line, plot2 & 3 as dots.  }

vars:swdir(0),swhi(0),swlo(0),trend(0),bc(0),swhi1(0),swlo1(0);

bc=bc+1; {bar counter used to offset swing line plot}

if h > h[1] and h[1] > h[2] and swdir <> 1 then begin  {swing direction
change to up}
	swdir=1;
	swhi1=swhi;swhi=h;
	plot1[bc](swlo,"swing");
	bc=0;
end;
if l < l[1] and l[1] < l[2] and swdir <> -1 then begin  {swing direction
change to dn}
	swdir=-1;
	swlo1=swlo;swlo=l;
	plot1[bc](swhi,"swing");
	bc=0;
end;

if l < swlo and swdir=-1 then begin
	swlo=l;
	bc=0;
end;
if h > swhi and swdir=1 then begin
	swhi=h;
	bc=0;
end;

if h > swhi1 then trend=1;
if l < swlo1 then trend=-1; 
if trend=1 then plot2(h,"trendup") else plot3(l,"trenddn");


___________________________
Rich Estrem, Tucson,Az.
estrem@xxxxxxxxxxxxx