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

Re: [amibroker] Re: Three Line Break Chart


  • Date: Sun, 29 Nov 2009 15:35:49 +0100
  • From: reinsley <reinsley@xxxxxxxx>
  • Subject: Re: [amibroker] Re: Three Line Break Chart

PureBytes Links

Trading Reference Links



// Three Line Break or TLB
// 3 line Break  Chart
// Laurent 14 Aug 2005 ver 1
// Custom Indicator, date axis does not apply
// i compare my TLB chart with broker and another software
// visual result in almost the same, but the 3 have small difference

  SetBarsRequired(10000,10000);

// initialize first element
NumBar = 0;
LastHigh=Close[1];
LastLow=Close[1];
LastStartHigh=Close[1];
LastStartLow=Close[1];

// Loop to produce the TLB values

for( i=1; i<BarCount-1; i++ )
{
if (numbar > 3 )
{
	M1=Max(TLBCB[numbar],TLBCE[numbar]);
	M2=Max(TLBCB[numbar-1],TLBCE[numbar-1]);
	M3=Max(TLBCB[numbar-2],TLBCE[numbar-2]);
	m4=Max(m1,m2);
	LastHigh=Max(m4,m3);

	M1=Min(TLBCB[numbar],TLBCE[numbar]);
	M2=Min(TLBCB[numbar-1],TLBCE[numbar-1]);
	M3=Min(TLBCB[numbar-2],TLBCE[numbar-2]);
	m4=Min(m1,m2);
	LastLow=Min(m4,m3);
}

if( Close[i]> Lasthigh)
	{
	numbar++;
	TLBCB[numbar]=LastStartHigh; // TLBCB Three Line Break Chart Begin (of bar)
	TLBCE[numbar]=Close[i]; // TLBCB Three Line Break Chart End (of bar)
	LastStartlow=LastHigh;
	LastHigh=Close[i];
	LastStartHigh=Close[i];
	}

if( Close[i]< LastLow)
	{
	numbar++;
	TLBCB[numbar]=LastStartLow;
	TLBCE[numbar]=Close[i];
	LastStartHigh=LastStartLow;
	Lastlow=Close[i];
	LastStartlow=Close[i];
	}

} // for

// move the chart to right end of chart space, ie last brick on last bar 
position
delta =  BarCount-1 - numbar;

TLBCB = Ref( TLBCB, -delta );
TLBCE = Ref( TLBCE, -delta );

rO = TLBCB;
rC = TLBCE;
rH = Max(rC,rO);
rL = Min(rC,rO);

// plot chart
PlotOHLC( rO, rH, rL, rC, "TLB" , colorBlack, styleCandle);
GraphXSpace=5;

Title = Name() + " - {{INTERVAL}} {{DATE}} - \nTLB Chart : "+rC;



Amruta Patil a écrit :
>  
> 
> Hi,
>  
> How can I get Three Line Break chart in AmiBroker?
>  
> Waiting for your reply.
>  
> Thanks
> Amrut
> 
> 



------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    amibroker-digest@xxxxxxxxxxxxxxx 
    amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/