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

Re: 3PB



PureBytes Links

Trading Reference Links

At 11:49 AM 1/3/2002 -0700, you wrote:
>Has anyone ever seen or created an ela for the quasi point and figure method
>called " 3 Point Break" ?
>Chris Evans
>Phoenix AZ
>

Chris - here is some code I posted  back in 2000 to plot 3pb. 
I assume this is what you are looking for.

regards,
rich


{Three point break indicator code written by Rich Estrem.

Description:
This code draws boxes based on closes which move up (or down) with each new
higher (or lower) close. A break of 3 higher (or lower) closes changes the 
direction and the color of the boxes. The dotted lines show the max close and 
the reversal (breakpoint)prices.

Setup: 
Set plot1 and plot2 as type 'point'. Make each a diff. color.
Set the indicator to plot in the same subgraph as your data (subgraph 1)
Boxes are yellow and red by default, so a black background works well.
This code does not need to update every tick.
Maxbarsback can be set manually to a low number like 10.
}

var:v1(0),v2(0),h1(0),h2(0),bp(c),cur(c),dir(0),d1(0),t1(0),c1(0),c2(0),c3(0);


if currentbar=2 then begin	{initialize some vars}
	if c > c[1] then dir=1 else dir=-1; {choose initial direction}
	bp=c[1]; {breakpoint/price}
	cur=c; {current max price}
	d1=d;t1=t;c1=c[1];c2=c[1];c3=c[1];
end else begin
	if dir=1  then begin
		if c > cur then begin  {draw a new up box}
			v1=TL_New(D1,T1,c1,D1,t1,c);
			v2=TL_New(D,T,c1,D,t,c);
			h1=TL_New(D1,T1,c1,D,t,c1);
			h2=TL_New(D1,T1,c,D,t,c);
			TL_SetColor(h1,7);TL_SetColor(h2,7);TL_SetColor(v1,7);TL_SetColor(v2,7);
			cur=c; {new current max price}			
			bp=c3;
			d1=d;t1=t; c3=c2;c2=c1;c1=c; 
		end else begin
			if c < bp then begin {then change direction to dn}
			v1=TL_New(D1,T1,c2,D1,t1,c);
			v2=TL_New(D,T,c2,D,t,c);
			h1=TL_New(D1,T1,c2,D,t,c2);
			h2=TL_New(D1,T1,c,D,t,c);
			TL_SetColor(h1,6);TL_SetColor(h2,6);TL_SetColor(v1,6);TL_SetColor(v2,6);
			cur=c; {new current max price}			
			dir=-1; {change direction}
			bp=c1;
			d1=d;t1=t;c1=c;c3=cur[1];
			end;
		end;
	end;

	if dir=-1  then begin
		if c < cur then begin  {draw a new dn box}
			v1=TL_New(D1,T1,c1,D1,t1,c);
			v2=TL_New(D,T,c1,D,t,c);
			h1=TL_New(D1,T1,c1,D,t,c1);
			h2=TL_New(D1,T1,c,D,t,c);
			TL_SetColor(h1,6);TL_SetColor(h2,6);TL_SetColor(v1,6);TL_SetColor(v2,6);
			cur=c; {new current max price}			
			bp=c3;
			d1=d;t1=t;c3=c2;c2=c1;c1=c;
		end else begin
			if c > bp then begin {then change direction to up}
			v1=TL_New(D1,T1,c2,D1,t1,c);
			v2=TL_New(D,T,c2,D,t,c);
			h1=TL_New(D1,T1,c2,D,t,c2);
			h2=TL_New(D1,T1,c,D,t,c);
			TL_SetColor(h1,7);TL_SetColor(h2,7);TL_SetColor(v1,7);TL_SetColor(v2,7);
			cur=c; {new current max price}			
			dir=1; {change direction}
			bp=c1;
			d1=d;t1=t;c1=c;c3=cur[1];
			end;
		end;
	end;			
end;

plot1(cur,"cur");
plot2(bp,"bp");






  • References:
    • 3PB
      • From: Chris Evans