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

Re: countback line



PureBytes Links

Trading Reference Links

just added the period

Plot(msCBLShort(5),"cbl",colorRed,1);

steph
> hello,
> the MS CBL that suits the Ms code looks like this one below( I 
have 
> not added the OR conditions, it seems correct
> you'll find it only for short side,
> in the trailing stop dll
> 
> with the name Plot(msCBLShort(),"cbl",colorRed,1);
> 
> steph
> 
> 
> 
> 
> for(int i=0; i < 5; i++)
> {
> Cbl.array[i]=EMPTY_VAL;
> }
> 
> for( i=5; i < nSize; i++)
> {
> loday=Low[i];
> for(int j=1;j<5;j++)
> {
> if(Low[i-j]<loday)
> loday=Low[i-j];
> }
> if(Low[i] > loday)
> {
> Cbl.array[i]=Cbl.array[i-1];
> }
> else
> {
> if( High[i-2]>High[i-1] && High[i-2]>High[i] 
> && High[i-1]>High[i] )
> Cbl.array[i]=High[i-2];
> else if ( High[i-3]>High[i-2] && High[i-3]
> >High[i-1] && High[i-3]>High[i]) 
> Cbl.array[i]=High[i-3];
> else if (High[i-4]>High[i-3] && High[i-4]
> >High[i-2] && High[i-4]>High[i-1] 
> && High[i-4]
> >High[i]) 
> Cbl.array[i]=High[i-4];
> else if (High[i-5]>High[i-4] && High[i-5]
> >High[i-3] && High[i-5]>High[i-2] 
> && High[i-5]
> >High[i-1] && High[i-5]>High[i]) 
> Cbl.array[i]=High[i-5];
> else
> Cbl.array[i]=Cbl.array[i-1];
> 
> }
> }
> 
> 
> return Cbl;
> }
> > please, you have to believe I never sent any request before 
> searching. I've found the Metastock CBL formula, yesterday, just 
by 
> Google, at 
> > 
> > http://www.guppytraders.com/Metastock%20Formulas/metastock%
> 20formula%206.htm#Countback%20line%20for%20Metastock
> > 
> > They actually say that the formula is a solution for Metastock. 
> Perhaps, the original could be found in the Guppy's book "Share 
> Trading: An Approach to Buying and Selling". They say, also, the 
> Metastock solution maybe isn't the best solution, but it's a 
working 
> solution.
> > Then I've found the same formula, maybe well readable, at
> > 
> > http://eis.pl/kr/AFM/e-w-Countback_line.html
> > 
> > I think this URL is in your country.
> > 
> > Finally, I found a Countback line method (not formula), 
described 
> exactly in the same way as Stephan in his dll's help file. This 
> method seems quite different from the Metastock one.
> > Try, please, to look at the second URL. The formula is clear 
> enough and there is also a chart.
> > 
> > Best regards and thanks in advance.
> > 
> > Franco
> > ----- Original Message ----- 
> > From: Tomasz Janeczko 
> > To: amibroker@xxxx 
> > Sent: Saturday, September 28, 2002 8:32 PM
> > Subject: Re: [amibroker] Re: countback line
> > 
> > 
> > Franco,
> > 
> > As it was mentioned on this list there is some doubt if MS 
> formula really represents the original,
> > so I encourage you to go to www.google.com and do some 
searching.
> > 
> > Please do a web search it is really useful. I remember someone 
> asking me for linear regression
> > not too long ago. I typed "linear regression" in the Google 
and 
> in 3 top results I found
> > very reasonable references.
> > 
> > It is easy, quick and does not hurt.
> > 
> > When you find some nice description - I will write the formula.
> > 
> > Best regards,
> > Tomasz Janeczko
> > amibroker.com
> > ----- Original Message ----- 
> > From: Franco Fornari 
> > To: amibroker@xxxx 
> > Sent: Saturday, September 28, 2002 8:22 PM
> > Subject: Re: [amibroker] Re: countback line
> > 
> > 
> > Tomasz,
> > 
> > thanks for your kind reply. I'll try to re-write the formula 
> in a more readable form and I'll send to you. If you will have a 
> spare moment, I will be happy, but if you have to spend too much 
> time, never mind, it's not a matter of life and death.
> > 
> > Thanks in advance and best regards,
> > 
> > Franco
> > 
> > 
> > ----- Original Message ----- 
> > From: Tomasz Janeczko 
> > To: amibroker@xxxx 
> > Sent: Saturday, September 28, 2002 8:00 PM
> > Subject: Re: [amibroker] Re: countback line
> > 
> > 
> > Franco,
> > 
> > MS has its PREV because in MS you can not write loops that 
> iterate through quotes.
> > In AmiBroker you can - in VBScript or JScript or DLL.
> > 
> > As for MS formula you quoted it is VERY, VERY unreadable 
and 
> if you want me to write 
> > VBScript I need some description of what it should in fact 
> do.
> > I don't have time to reverse-engineer MS wrestling with 
PREV.
> > 
> > 
> > Best regards,
> > Tomasz Janeczko
> > amibroker.com
> > ----- Original Message ----- 
> > From: Franco Fornari 
> > To: amibroker@xxxx 
> > Sent: Saturday, September 28, 2002 7:31 PM
> > Subject: Re: [amibroker] Re: countback line
> > 
> > 
> > Ken,
> > 
> > as I wrote in my first message, I don't have forgotten 
> what Tomasz said about PREV and AMA. They are not identical. AMA 
is 
> an adaptive moving average, PREV works with other functions 
allowing 
> them to refer to themselves.
> > About AMA, in fact its internal logic makes inessential 
> any function like PREV, but remains an adaptive moving average, 
> that's all. Metastock's CBL don't uses any average, it only refers 
> to hard values, and PREV have to do the same.
> > 
> > Best regards,
> > 
> > Franco
> > ----- Original Message ----- 
> > From: Ken Close 
> > To: amibroker@xxxx 
> > Sent: Saturday, September 28, 2002 6:58 PM
> > Subject: RE: [amibroker] Re: countback line
> > 
> > 
> > Franco:
> > 
> > Tomasz will jump in here sometime and say that the AMA 
> or ___? other function in Amibroker does exactly what PREV does in 
> MS and does it faster. I do not use it and so do not have it 
> committed to memory. You could search in the amibroker yahoo 
group 
> for PREV or AMA or wait and perhaps Tomasz or someone else will 
post 
> a past message on this topic.
> > 
> > Ken
> > -----Original Message-----
> > From: Franco Fornari [mailto:ffpsi@x...]
> > Sent: Saturday, September 28, 2002 12:09 PM
> > To: amibroker@xxxx
> > Subject: Re: [amibroker] Re: countback line
> > 
> > 
> > Hello,
> > 
> > yes, I know there isn't in AFL a function equivalent 
to 
> PREV. I tried to use a VB Script, but I'm not able enough. Do you 
> know if there is, somewhere on the WEB, the original Guppy's 
formula?
> > 
> > Best regards,
> > 
> > Franco 
> > ----- Original Message ----- 
> > From: Stephane Carrasset 
> > To: amibroker@xxxx 
> > Sent: Saturday, September 28, 2002 4:51 PM
> > Subject: [amibroker] Re: countback line
> > 
> > 
> > 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.
> > 
> > 
> > 
> > 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. 
> > 
> > 
> > 
> > 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. 
> > 
> > 
> > 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. 
> > 
> > 
> > 
> > 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. 
> > 
> > 
> > 
> > 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. 
> > 
> > 
> > 
> > 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. 
> > 
> > 
> > Yahoo! Groups Sponsor 
> > ADVERTISEMENT
> > 
> > 
> > 
> > 
> > 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.