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

Re: [amibroker] Re: Countback Line dll



PureBytes Links

Trading Reference Links

> Hello,


the afl code of the dll for long is below:
I can add the dll in 3rd party if you want, the dll is just a little 
faster when you backtest.

stephane

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,"",2,1);
Plot(C,"",1,64);
//Plot(scCBLLong(),"",colorBlue,1);

> Here is an attempt I did some time ago. It is not perfect as it picks
> highs/lows from history instead of just recent ones.
> It should give enough for a starting point for you to create your own
>
> // INDICATOR
> //Count Back Line
> //by Graham Kavanagh 22 May 2003
> //
> Plot(C, "Close", colorBlack, styleBar+styleNoLabel);
>
> period = 3;
> Bar = SelectedValue(BarIndex());
> LastBar = LastValue(BarIndex());
> start = Lastbar-bar;
>
> LowerLow[0] = SelectedValue(L);
>
> for ( j=1; j<=period; j++ )
> {
> for ( i=1 ; i < Bar ; i++ )
> {
>   if ( L[i] < LowerLow[j-1] )
>   {
>    LowerLow[j] = L[i];
>   }
> }
> }
> Lowerline = SelectedValue(LowerLow[period]);
> BarL   = ValueWhen( L==Lowerline, BarIndex(), 1 );
> CBLow  = IIf( BarIndex()>=BarL, Lowerline, Null );
> Plot(CBLow, EncodeColor(colorRed)+ "3 day CB Low", colorRed, styleDots);
>
> //Plot(SelectedValue(L), EncodeColor(colorRed)+ "Bar Low", colorRed,
> styleLine);
>
>
> HigherHigh[0] = SelectedValue(H);
> for ( j=1; j<=period; j++ )
> {
> for ( i=1; i < Bar ; i++ )
> {
>   if ( H[i] > HigherHigh[j-1] )
>   {
>    HigherHigh[j] = H[i];
>   }
> }
> }
>
>
> Higherline = SelectedValue(HigherHigh[period]);
> BarH   = ValueWhen( H==Higherline, BarIndex(), 1 );
> CBHigh  = IIf( BarIndex()>=BarH, Higherline, Null );
>
>
> //Plot(SelectedValue(H), EncodeColor(colorGreen)+ "Bar high", colorGreen,
> styleLine);
> Plot(CBHigh, EncodeColor(colorGreen)+ "3 day CB High", colorGreen,
> styleDots);
>
> Title = Name() + " " + Date() + " / " + BarCount + " / " + bar + " / " +
> Lastbar + " ? "+ L[0] + " ? ";
>
> Cheers,
> Graham
> http://e-wire.net.au/~eb_kavan/ <http://e-wire.net.au/%7Eeb_kavan/>
>
> -----Original Message-----
> From: Col [mailto:colgiddins@xxxxxxxxx]
> Sent: Wednesday, December 29, 2004 1:48 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Re: Countback Line dll
>
>
>
>
> goldwing01_1999
> Thanks for the reply but the 3 line break is not what I'm looking
> for.
> Guppy's countback line is a variation of Stowell's 3 bar nett.
> Thanks
> Col
>
> <goldwing01_1999@xxxx> wrote:
> >
> > is this what you are looking for.
> >
> > http://finance.groups.yahoo.com/group/amibroker/message/25914
>
>
>
>
>
>
>
>
>
>
> Check AmiBroker web page at:
> http://www.amibroker.com/
>
> Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
> Check AmiBroker web page at:
> http://www.amibroker.com/
>
> Check group FAQ at: 
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
>
>
> *Yahoo! Groups Sponsor*
> ADVERTISEMENT
> click here 
> <http://us.ard.yahoo.com/SIG=129dogpen/M=294855.5468653.6549235.3001176/D=groups/S=1705632198:HM/EXP=1104391127/A=2455396/R=0/SIG=119u9qmi7/*http://smallbusiness.yahoo.com/domains/> 
>
>
>
> ------------------------------------------------------------------------
> *Yahoo! Groups Links*
>
>     * To visit your group on the web, go to:
>       http://groups.yahoo.com/group/amibroker/
>        
>     * To unsubscribe from this group, send an email to:
>       amibroker-unsubscribe@xxxxxxxxxxxxxxx
>       <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe>
>        
>     * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>
>
>
> __________ Information NOD32 1.940 (20041205) __________
>
> Ce message a ete verifie par NOD32 Antivirus System.
> http://www.nod32.com





------------------------ Yahoo! Groups Sponsor --------------------~--> 
$4.98 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/Q7_YsB/neXJAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> 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/