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

[amibroker] Re: Guppy Count Back Line



PureBytes Links

Trading Reference Links

I've just uploaded a plugin to the files area that I've been meaning
to make available for a while. It's primarily for generating trailing
stops from arbitrary price arrays, but includes an implementation of
the Guppy Countback line.

The file is called "GP_Stops_v2.3.zip" and includes same AFL code and
a PDF manual. Note that all dates mentioned are in Australian date
format (dd/mm/yyyy), not US format (this relates to the plugin's
ability to use simple portfolio files).

I can't guarantee that the CBL will exactly match other ones either
though. I haven't specifically included countback entry, but a short
stop can be used for long entry, with I think much the same result.

One area that I believe my implementation does differ from Guppy's
definition is with the way he specifies starting at the most recent
high (uptrend) or low (downtrend). For example, for a long stop I
believe he starts at the bar with the most-recent highest High value,
whereas mine effectively starts at the bar with the most-recent
highest Low value. Often the result is the same, but where his start
bar happens to be very long with a relatively low Low value, and this
is followed by quite a few short bars inside that range, his CBL will
never rise higher whereas mine may (which personally I think is better).

Anyway, try it and see what you think.

Regards,
GP


--- In amibroker@xxxxxxxxxxxxxxx, "Stan Graham" <asahi3@xxx> wrote:
>
> 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 amibroker@xxxxxxxxxxxxxxx, "Donald F Lindberg" <dlindber@> 
> 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: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] 
> On Behalf
> > Of Stan Graham
> > Sent: Monday, September 08, 2008 1:25 PM
> > To: amibroker@xxxxxxxxxxxxxxx
> > Subject: [amibroker] Guppy Count Back Line
> > 
> > 
> > 
> > Has anyone coded the Guppy Count Back Entry line in AmiBroker?
> > Stan
> >
>



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

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

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

For other support material please check also:
http://www.amibroker.com/support.html
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:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto: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/