Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

shubhankar for Amibroker (AFL)

Copy & Paste Friendly
// Subhankar chakraborty
// ph8768142154,
// waves analysisest
// pivot analysisest
// box analysisest
//afl
SetBarsRequired(1000);
BarLum1         = Param("Bar Color Intensity", 8, 0, 10,01);
UpBarColor      = ColorBlend(ColorRGB(5,36,5), ColorRGB(10,75,10), BarLum1);
DnBarColor      = ColorBlend(ColorRGB(36,5,5), ColorRGB(75,10,10), BarLum1);
BarColor        = IIf(Close > Open, UpBarColor, DnBarColor);
SetBarFillColor(BarColor);
stylecndl=ParamToggle("Bar or Candle chart?","Bar|Candle",0);
Showboll=ParamToggle("Show Bollinger Bands","No|Yes",0);
showgann=ParamToggle("Show shortest path?","No|Yes",1);
nobars=Param("N bars = ",2,1,5,1);
upbar=downbar=j=k=0;
 
 
if (nobars==1)upbar=H>Ref(H,-1);
if (nobars==2)upbar=H>Ref(H,-1) AND Ref(H,-1)>Ref(H,-2);
if (nobars==3)upbar=H>Ref(H,-1) AND Ref(H,-1)>Ref(H,-2) AND Ref(H,-2)>Ref(H,-3);
if (nobars==4)upbar=H>Ref(H,-1) AND Ref(H,-1)>Ref(H,-2) AND Ref(H,-2)>Ref(H,-3) AND Ref(H,-3)>Ref(H,-4);
if (nobars==5)upbar=H>Ref(H,-1) AND Ref(H,-1)>Ref(H,-2) AND Ref(H,-2)>Ref(H,-3) AND Ref(H,-3)>Ref(H,-4) AND Ref(H,-4)>Ref(H,-5);;
 
 
if (nobars==1)downbar=L<Ref(L,-1);
if (nobars==2)downbar=L<Ref(L,-1) AND Ref(L,-1)<Ref(L,-2);
if (nobars==3)downbar=L<Ref(L,-1) AND Ref(L,-1)<Ref(L,-2) AND Ref(L,-2)<Ref(L,-3);
if (nobars==4)downbar=L<Ref(L,-1) AND Ref(L,-1)<Ref(L,-2) AND Ref(L,-2)<Ref(L,-3) AND Ref(L,-3)<Ref(L,-4);
if (nobars==5)downbar=L<Ref(L,-1) AND Ref(L,-1)<Ref(L,-2) AND Ref(L,-2)<Ref(L,-3) AND Ref(L,-3)<Ref(L,-4) AND Ref(L,-4)<Ref(L,-5);
 
 
if (stylecndl)stylec=styleCandle;
else stylec=styleBar;
 
tline=tlinebs=barhi=barlo=beglo=beghi=endi=begi=hilo=Lastlo=Lasthi=lastlo1=lasthi1=0;
for (i=1;i<BarCount;i++)
{
 
if (i>=nobars+2)
{
//if (i>begi+1)PlotText(WriteVal(I>begi+1,1.0),i,H[i]+15,colorOrange);    
 
 
    if ((upbar[i] AND i>beglo ) OR (H[i]>H[beghi]))
    {
        if (((beghi>beglo AND H[i]>H[beghi]) OR beghi==0) OR beglo>beghi)
        {
            tline[i]=H[i];
            barhi=1;
            barlo=0;
            prevhi=beghi;
            beghi=i;
            if ((H[beghi]>H[prevhi] AND prevhi>beglo) OR beglo>prevhi) {lasthi1=Lasthi;Lasthi=i;}
        }
    }
    if ((downbar[i] AND i>beghi )  OR (L[i]<L[beglo] AND i!=beghi))
    {
        if (((beglo>beghi AND L[i]<L[beglo]) OR beglo==0) OR beghi>beglo)
        {
            tline[i]=L[i];
            barlo=1;
            barhi=0;
            prevlo=beglo;
            beglo=i;
            if ((L[beglo]<L[prevlo] AND prevlo>beghi) OR beghi>prevlo){lastlo1=lastlo;Lastlo=i;}
        }
    }
}
 
 
    if (i==beglo)
    {
 
        if (prevlo>beghi)
        {
            if (showgann==0){begi=prevlo; begval=L[prevlo];}
            else {begi=Lasthi; begval=H[lasthi];}
            endi=beglo;endval=L[beglo];
        }
        else if (beghi>prevlo)
        {
 
            if (showgann==0){begi=beghi; begval=H[beghi];}
            else {begi=Lasthi; begval=H[lasthi];}
            endi=beglo;endval=L[beglo];
        }
    }
    if (i==beghi)
    {
        if (prevhi>beglo)
        {
            if (showgann==0){begi=prevhi; begval=H[prevhi];}
            else {begi=Lastlo; begval=L[Lastlo];}
 
            endi=beghi;endval=H[beghi];
        }
        else if (beglo>prevhi)
        {
            if (showgann==0){begi=beglo; begval=L[beglo];}
            else {begi=Lastlo; begval=L[Lastlo];}
            endi=beghi;endval=H[beghi];
        }
    }
 
    if (endi-begi>1)
    {
        incr=(endval-begval)/(endi-begi);
        for (k=begi;k<=endi;k++)
        {
            tline[k]=begval+(k-begi)*incr;
        }
    }   
 
if (tline[i]==0)tline[i]=Null;
//trend line end
}
tline=IIf(tline>0,tline,Null);
Plot(tline,"Trendline",colorWhite,styleLine);
//PlotOHLC(ox,Hx,Lx,cx,"Gann Trend",colorGreen,styleBar);
if (showboll)
{
    _SECTION_BEGIN("B");
    P = ParamField("Price field",-1);
    Periods = Param("Periods", 15, 2, 300, 1 );
    Width = Param("Width", 2, 0, 10, 0.05 );
    Color = ParamColor("Color", colorCycle );
    Style = ParamStyle("Style");
    Plot( BBandTop( P, Periods, Width ), "BBTop" + _PARAM_VALUES(), Color, Style ); 
    Plot( BBandBot( P, Periods, Width ), "BBBot" + _PARAM_VALUES(), Color, Style ); 
    _SECTION_END();
 
 
    _SECTION_BEGIN("MA");
    P = ParamField("Price field",-1);
    Periods = Param("Periods", 15, 2, 300, 1, 10 );
    Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); 
    _SECTION_END();
}
Back