Thank you, Don
I have that code but the output does not agree with the Guppy
MetaStock output. I have BK (Bank of NY Mellon) on my screen in both
AmiBroker and MetaStock - CBL is 34.19 in AB and 34.93 in MS also the
line drawn is much different. MS allows for the lookback period to be
changed (set at 10 periods now) but I cannot find the countback
period in the CBL code! The AB CBL is also below the last price bar -
not a good entry point! In fact it is below the last 5 price bars,
whereas the MS CBL passes through the last 6 (six) price bars.
Stan
--- In [email protected], "Donald F Lindberg" <[EMAIL PROTECTED]>
wrote:
>
> Stan,
> Below find code that Ipulled from AFL Library for Guppy Coutback.
>
> _SECTION_BEGIN("Guppy Countback Line");
>
> /* Stephane Carrasset's Countback Line (CBL) popularized by Daryl
Guppy
>
> Refer to amibroker posting 30th December 2004 */
>
> nR=2;
>
> Cbl[nR]=Null;
>
> bCBL=False;
>
> for( i=nR; i < BarCount; i++)
>
> {
>
> if( (Low[i-2]<Low[i-1]) && (Low[i-1]<Low[i]) )
>
> {
>
> Cbl[i] = Low[i-2];
>
> bCBL = True;
>
> }
>
> else if (bCBL)
>
> {
>
> if (Low[i] < Cbl[i-1])
>
> {
>
> Cbl[i] = Cbl[i-1];
>
> bCBL = False;
>
> }
>
> else
>
> {
>
> n = nR;
>
> minval[i] = Low[i];
>
> breakloop= False;
>
> for (j = 1; NOT(breakloop) && j <= i; j++)
>
> {
>
> if (Low[i-j] < minval[i])
>
> {
>
> if (n>1)
>
> {
>
> minval[i] = Low[i-j];
>
> n--;
>
> }
>
> else
>
> {
>
> Cbl[i] = Low[i-j];
>
> breakloop=True;
>
> }
>
> }
>
> }
>
> if (Cbl[i] < Cbl[i-1])
>
> Cbl[i] = Cbl[i-1];
>
> }
>
> }
>
> else
>
> {
>
> Cbl[i] = Cbl[i-1];
>
> }
>
> if (Cbl[i]==0)
>
> Cbl[i] = Cbl[i-1];
>
> }
>
> Plot(Cbl,"",colorGreen,1);
>
> Plot(C,"",-1,64);
>
> _SECTION_END();
>
>
> _____
>
> From: [email protected] [mailto:[EMAIL PROTECTED]
On Behalf
> Of Stan Graham
> Sent: Monday, September 08, 2008 1:25 PM
> To: [email protected]
> Subject: [amibroker] Guppy Count Back Line
>
>
>
> Has anyone coded the Guppy Count Back Entry line in AmiBroker?
> Stan
>