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

Re: [amibroker] indicators



PureBytes Links

Trading Reference Links

that fine tomasz as the new version and your great newsletter are of a
higher priority ..
heres a ms fomula for the count back
Countback line for Metastock.

(Note. This is very good, but the limitation is the lookback period. The

calculation point for the CBL line might be 5, 10, 15, 30 days away from

todays date.Also watch for the way 'gap' days are treated. Daryl Guppy)

Copied from StockCentral - Thanks Ken D

Well .... last weekend I replied to a post requesting a MetaStock solution
for calculating the Countback Line discussed in Daryl Guppy's book "Share
Trading: An Approach to Buying and Selling". Subequently, about 30 requests
for the formulas I use were received. Not unexpectedly, a few defects were
found with the original offerings. This helped forge a somewhat more robust
solution, which is here given to the wider audience of this Forum, so that
further improvements may be forthcoming. Alternatives of presentation style
are many, according to taste, but we are here requesting improvements in
substance, identification of possible flaws, or have real simplification
benefits - please provide solutions where possible.

ACKNOWLEDGEMENTS .... With thanks to the several people who have commented,
all constructively it is pleasing to say, particular credit is warranted by
the significant contributions from Bryan Stanton and Siobhan Channon.

LIMITATIONS .... With MetaStock, there seems to be a need for two different
formulas to handle the issue: - one for the CBL from a LOW (CBLlo), - the
other for the CBL from a HIGH (CBLhi). The formulas given below were
generated using v.6.52. Because of the use of PREV they won't work in some
earlier MetaStock versions it seems, though a bit of thought should overcome
this limitation - anyone able to comment? As written they are based upon
relative prices over a DEFAULT cover of 13 days (but adjustable from 3 to 55
days) - this is one of the potential weaknesses which commands individual
interpretation for a particular equity or contract, which may cycle more or
less frequently and require different timeframes. Other indicators and
assessments are, of course, needed to gauge the probability of a
CBL-indicated counter-trend holding. Also, for particularly choppy or
indecisive circumstances there may be a need to extend the Ref(H or L, -5)
to a greater number of comparison days by appropriate copying and
adjustments to the basically simple pattern in these formulas - but if it
came to this perhaps the trade should be left alone anyway! Owing to price
vagaries it is not unusual for a CBLhi to be less than a CBLlo calculation,
or the converse, especially with low-gradient trends or sideways price
movements.

NOTE: With each formula below, copy exactly from "HighDays" or "LowDays"
down to "PREV )))))" into the Indicator Builder.

CBLhi:

HighDays := Input("Enter # days to cover last HIGH for CBL calc'n:", 3, 55,
13);

If(HIGH < HHV(HIGH, HighDays), {then ...} PREV, {previous CBLhi, else...}
If(Ref(L,-2) < Ref(L,-1) AND Ref(L,-2) < L AND Ref(L,-1) < L, {then ...}
Ref(L,-2), {2nd day back low, else...} If((Ref(L,-3)< Ref(L,-2) AND
Ref(L,-3) < Ref(L,-1) AND Ref(L,-3) < L) AND (Ref(L,-2)< L OR Ref(L,-1) <
L), {then ... } Ref(L,-3), {3rd day back low, else...} If((Ref(L,-4)<
Ref(L,-3) AND Ref(L,-4) < Ref(L,-2) AND Ref(L,-4) < Ref(L,-1) AND Ref(L,-4)
< L) AND (Ref(L,-3)< L OR Ref(L,-2) < L OR Ref(L,-1) < L), {then... }
Ref(L,-4), {4th day back low, else...} If((Ref(L,-5)< Ref(L,-4) AND
Ref(L,-5) < Ref(L,-3) AND Ref(L,-5) < Ref(L,-2) AND Ref(L,-5) < Ref(L,-1)
AND Ref(L,-5) < L) AND (Ref(L,-4)< L OR Ref(L,-3) < L OR Ref(L,-2) < L OR
Ref(L,-1) < L), {then ...} Ref(L,-5), {5th day back low, else...} PREV )))))

and for the CBL from a LOW

CBLlo:

LowDays := Input("Enter # days to cover last LOW for CBL calc'n:", 3, 55,
13);

If(LOW > LLV(LOW, LowDays), {then ...} PREV, {previous CBLlo, else...}
If(Ref(H,-2) > Ref(H,-1) AND Ref(H,-2) > H AND Ref(H,-1) > H, {then ...}
Ref(H,-2), {2nd day back high,else...} If((Ref(H,-3)> Ref(H,-2) AND
Ref(H,-3) > Ref(H,-1) AND Ref(H,-3) > H) AND (Ref(H,-2)> H OR Ref(H,-1) >
H), {then ... } Ref(H,-3), {3rd day back high,else...} If((Ref(H,-4)>
Ref(H,-3) AND Ref(H,-4) > Ref(H,-2) AND Ref(H,-4) > Ref(H,-1) AND Ref(H,-4)
> H) AND (Ref(H,-3)> H OR Ref(H,-2) > H OR Ref(H,-1) > H), {then... }
Ref(H,-4), {4th day back high,else...} If((Ref(H,-5)> Ref(H,-4) AND
Ref(H,-5) > Ref(H,-3) AND Ref(H,-5) > Ref(H,-2) AND Ref(H,-5) > Ref(H,-1)
AND Ref(H,-5) > H) AND (Ref(H,-4)> H OR Ref(H,-3) > H OR Ref(H,-2) > H OR
Ref(H,-1) > H), {then ...} Ref(H,-5), {5th day back high,else...} PREV )))))

Please advise of any problems or suggested improvements in calculating the
CBL. It is again emphasized that this is by no means proposed as the best
solution, but as ONE solution which seems to work. Regards.




----- Original Message -----
From: "Tomasz Janeczko" <tjaneczk@xxxx>
To: <amibroker@xxxxxxxxxxx>
Sent: Friday, December 29, 2000 6:56 AM
Subject: Re: [amibroker] indicators


> Hi David and All,
>
> Well... and you want an AFL code for this one? OK will see what I can
do...
> but this will wait a little because I am now working on the next release
of AmiBroker
> and ... the next issue of the newsletter. I skipped one issue due to
holiday season
> ... hope you excuse me.
>
> Best regards,
> Tomasz Janeczko
> ===============
> AmiBroker - the comprehensive share manager.
> http://www.amibroker.com
>
> ----- Original Message -----
> From: David Holzgrefe <dtholz@xxxx>
> To: <amibroker@xxxxxxxxxxx>
> Sent: Thursday, December 28, 2000 12:59 PM
> Subject: [amibroker] indicators
>
>
> > ok tomasz whilst your on a roll are u familar with Darryl Guppys count
back
> > line ?
> >
> > Entry is applied by drawing a line towards the left form the high of the
bar
> > with the lowest low.
> > The 1st bar that the line hits is used to set up the 2nd line to the
left by
> > starting from the high again.
> > >From the next bar in the sequence a line is drawn from the high to the
> > right.
> > A close at this level indicates an enrty point ..
> >
> > the reverse procedure from the enrty is used to caculate the cbl exit ..
the
> > cbl is recaculated daily to provide a new exit eveytime a new high is
made
> > ...referred to as a moving stop loss..
> >
> >
> >
> >
> >
>
>
>
>
>
>