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

Take Profit 5 Green Profitunity for Amibroker (AFL)

2 / 5 (Votes 4)
profitunity, amibroker

This is part of profitunity system from Bill wiliams books, this signal for take profit when five green Zone break the low


Indicator / Formula

Copy & Paste Friendly
// Setting Chart & plot candle
_SECTION_BEGIN( "Price" );
SetChartOptions( 0, chartShowArrows | chartShowDates );
_N( Title = StrFormat( "{{NAME}} - {{INTERVAL}} {{DATE}}  Open %g,  High %g,  Low %g,  Close %g (%.1f%%) , \n{{VALUES}}", O, H, L, C,  SelectedValue( ROC( C, 1 ) ) ) );
Plot( C, "Close", ParamColor( "Warna candle", colorDefault ), styleNoTitle | ParamStyle( "Style" ) | GetPriceStyle() );
//------- ZONE Definition -------------------
    A = (H+L)/2 ;
    AO=MA(A,5)-MA(A,34); //2nd Wise Man
        AORed1=Ref(AO,-1)<=Ref(AO,-2);   AORed2=Ref(AO,-2)<=Ref(AO,-3);   AORed3=Ref(AO,-3)<=Ref(AO,-4);   AORed4=Ref(AO,-4)<=Ref(AO,-5);
        AOGreen1=Ref(AO,-1)>Ref(AO,-2); AOGreen2=Ref(AO,-2)>Ref(AO,-3);   AOGreen3=Ref(AO,-3)>Ref(AO,-4); AOGreen4=Ref(AO,-4)>Ref(AO,-5);
        AOabove0=AO>0;   AObelow0=AO<0; 
    AC=AO-MA(AO,5);// Accelerator/Decelerator
        ACRed1=Ref(AC,-1)<Ref(AC,-2); ACRed2=Ref(AC,-2)<Ref(AC,-3);   ACRed3=Ref(AC,-3)<Ref(AC,-4);    ACRed4=Ref(AC,-4)<Ref(AC,-5);
        ACGreen1=Ref(AC,-1)>Ref(AC,-2); ACGreen2=Ref(AC,-2)>Ref(AC,-3);   ACGreen3=Ref(AC,-3)>Ref(AC,-4); ACGreen4=Ref(AC,-4)>Ref(AC,-5);
    // Zone Definition
    GreenZone=AOGreen AND ACGreen;
        GreenZ5=GreenZone AND (AOGreen1 AND ACGreen1) AND (AOGreen2 AND ACGreen2) AND (AOGreen3 AND ACGreen3) AND (AOGreen4 AND ACGreen4);
        GreenZ4=GreenZone AND (AOGreen1 AND ACGreen1) AND (AOGreen2 AND ACGreen2) AND (AOGreen3 AND ACGreen3);
        GreenZ3=GreenZone AND (AOGreen1 AND ACGreen1) AND (AOGreen2 AND ACGreen2);
        GreenZ2=GreenZone AND (AOGreen1 AND ACGreen1);
    RedZone=AORed AND ACRed;
        RedZ5=RedZone AND (AORed1 AND ACRed1) AND (AORed2 AND ACRed2) AND (AORed3 AND ACRed3) AND (AORed4 AND ACRed4);
        RedZ4=RedZone AND (AORed1 AND ACRed1) AND (AORed2 AND ACRed2) AND (AORed3 AND ACRed3);
        RedZ3=RedZone AND (AORed1 AND ACRed1) AND (AORed2 AND ACRed2);
        RedZ2=RedZone AND (AORed1 AND ACRed1);
    GreyZone= (AOGreen AND ACRed) OR (AORed AND ACGreen);
        GreyZ2=GreyZone AND ((AOGreen1 AND ACRed1) OR (AORed1 AND ACGreen1));
        GreyZ3=GreyZ2 AND ((AOGreen2 AND ACRed2) OR (AORed2 AND ACGreen2));
        GreyZ4=GreyZ3 AND ((AOGreen3 AND ACRed3) OR (AORed3 AND ACGreen3));
        GreyZ5=GreyZ4 AND ((AOGreen4 AND ACRed4) OR (AORed4 AND ACGreen4));
    Zonecolor= IIf(GreenZone,colorBrightGreen,IIf(RedZone,colorRed,colorGrey50));
 PlotZone=ParamToggle("Plot Zone?","No|Yes",1) ;
    {Plot(2,"  Zone",Zonecolor,styleOwnScale|styleArea|styleNoLabel|styleNoTitle, -0.5, 100 );}
//Take Profit 5 green
TP5G= Ref( GreenZone, -4 ) AND Ref( GreenZone, -3 ) AND Ref( GreenZone, -2 ) AND Ref( GreenZone, -1 ) AND GreenZone ;

//PlotShape TP 5 Green
PlotTP5G = ParamToggle("Plot Take Profit 5 Green ?","No|Yes",1);
if ( PlotTP5G)
PlotShapes( IIf(TP5G , shapeStar,0),colorGrey50, 0, L,- 25);
// Tittle Take Profit TP 5 Green
_N(Title=Title+EncodeColor(colorGrey50)+WriteIf(TP5G,"\n\n"+"TP5G = "+L+ "\n\n"+"TP5G Hit = "+(L-TickSize),""));



Leave Comment

Please login here to leave a comment.