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

Re: countback line - Indicator



PureBytes Links

Trading Reference Links

Hi Folks

CBL Indicator for AB ?? This may be what you want, below. Think Geoff 
Mulhall complied the afl sometime before the plugin came along??

HighDays =13; 
A1=IIf(Cum(C<0),1,0);
Aa=H<Ref(HHV(H,Highdays),-1);
bb=Cum(Aa==1);
dd=IIf(bb==Ref(bb,-1),bb-bb +bb,0);
ee=IIf(BarsSince(dd==0)>1,ValueWhen(bb,L,0),0);
kk=IIf(ee==0,Ref(ValueWhen(ee,L,1),ee),0);

zz=IIf(High < HHV(High, HighDays),kk==1,IIf(Ref(L,-2) < Ref(L,-1) AND 
Ref(L,-2) < L AND Ref(L,-1) < L, Ref(L,-2), IIf((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), Ref(L,-3), IIf((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), Ref(L,-4), IIf((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), Ref(L,-5),0))))); 

Aaa=zz==0 + kk==0;
bba=Cum(1);
dda=IIf(bba=Ref(bba,-1),bba-bba +bba,0);
eea=IIf(BarsSince(aaA==0)==1,aaa,0);
ffa=IIf(eea=0 ,Cum(eea==1) AND BarsSince(eea==1)==1,Cum(eea>1));
kka=IIf(eea>Ref(eea,-1),Ref(ValueWhen(eea,eea,1),eea),zz);
ssa=IIf(Aaa,ValueWhen(kkA>0,kka,1),ValueWhen(zz==0,L,1));
Plot(HHV(ssa,2),"Count Back Line Value",2,4);
Plot(C,"Todays Close",2,64);


If you want the Metastock version look at Daryl Guppy's site here :

http://www.guppytraders.com/Metastock%20Formulas/metastock%20formula%
206.htm#Countback line for Metastock

also 

http://www.guppytraders.com/Metastock%20Formulas/formula%20index.htm

regards

pacific


---------------------------------------------------------------------
--- In amibroker@xxxx, "Stephane Carrasset" <nenapacwanfr@xxxx> wrote:
> hello,
> 
> there is not prev function in Amibroker
> prev is a recursive function, 
> BUT you can defind it with a scripting language
> my choise was since one year was C++
> but there is jscript and vbscript
> 
> about the cbl, I think the ms version is not matching the guppy 
> principles but only an adaptation .
> this is not the best trailing stop...
> 
> steph
> > 
> > thanks for your reply. Maybe you are referring to the dll shared 
> by Stephan. I know it, but its logic seems rather different and I'd 
> like to match it against Metastock's CBL.
> > 
> > Thanks again and best regards
> > 
> > Franco
> > ----- Original Message ----- 
> > From: grant 
> > To: amibroker@xxxx 
> > Sent: Saturday, September 28, 2002 4:14 PM
> > Subject: Re: [amibroker] countback line
> > 
> > 
> > Franco, 
> > CBL has been converted somewhere here before but I can't 
> find it at the moment, 
> > maybe if you check AB website formular page. I have a feeling 
it 
> was also in one 
> > of Steven's DLL's. Sorry I'm not much help to you but at least 
> you know it's here 
> > somewhere, I'll keep looking. 
> > Grant 
> > Franco Fornari wrote: 
> > 
> > Hello Tomasz and All, sorry if I propose the same question 
> again, but I'd need to know if it's possible to convert from 
> Metastock language to AFL any formula containing PREV function. 
> Tomasz showed many times, in past, how work AMA and AMA2 but, if 
I'm 
> not wrong, this case seems different, because in "Countback line" 
> Metastock formula, PREV doesn't refer to any averages but to hard 
> values. Is it possible to translate the following formula to AFL? 
> 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 ))))) 
Any 
> suggestion will be wellcome. Best regards, Franco 
> > 
> > 
> > 
> > Post AmiQuote-related messages ONLY to: amiquote@xxxx 
> > (Web page: http://groups.yahoo.com/group/amiquote/messages/) 
> > 
> > Check group FAQ at: 
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> > 
> > Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
> Service.