Join our facebook group for Amibroker afl code discussion https://www.facebook.com/groups/603980776889348

Very-Accurate-Candle-Chart-Buy-Sell-Zone

Very-Accurate-Candle-Chart-Buy-Sell-Zone
Very-Accurate-Candle-Chart-Buy-Sell-Zone

//www.aflcode.com
_SECTION_BEGIN("");

SwingTrd1 = 100 * (Close - ((MA(C,2)+

MA(MA(C,2),2)+
MA(MA(MA(C,2),2),2) +
MA(MA(MA(MA(C,2),2),2),2) +
MA(MA(MA(MA(MA(C,2),2),2),2),2) +
MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2) +
MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2), 2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2), 2),2),2),2))/10))/(HHV(C,10)-LLV(C,10));

SwingTrd2=EMA(SwingTrd1,30);
SwingTrd3=EMA(SwingTrd2,30);

RMO= EMA(SwingTrd1,81);

Buy=Cross(SwingTrd2,SwingTrd3);
Sell=Cross(SwingTrd3,SwingTrd2);

Bull_Trend=EMA(SwingTrd1,81)>0;
Bear_Trend=EMA(SwingTrd1,81)<0;

Ribbon_kol=IIf(Bull_Trend,colorGreen, IIf(Bear_Trend,colorRed, colorBlack));

Plot(1, "ribbon", Ribbon_kol, styleOwnScale|styleArea|styleNoLabel, -0.5,100);

Impulse_UP= EMA(SwingTrd1,30) > 0;
Impulse_Down= EMA(SwingTrd1,81) < 0;

bar_kol=IIf(impulse_UP, colorGreen, IIf(impulse_Down, colorDarkRed,IIf(Bull_Trend, colorRed, colorGreen)));

Plot(Close,"Close",bar_kol,styleCandle | styleThick );

shape = Buy * shapeUpArrow + Sell * shapeDownArrow;

PlotShapes( shape, IIf( Buy, colorBrightGreen, colorRed ),0, IIf( Buy, Low, High ) );

Plot(EMA(C,20),"S ema",colorPaleBlue,styleLine|styleNoLabel);
Plot(EMA(C,60),"L ema",colorLavender,styleDashed|styleNoLabel);
Plot(EMA(C,200),"L ema",colorCustom13,styleDashed|styleNoLabel);

_SECTION_END();


_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | styleHidden | ParamStyle("Style") | GetPriceStyle()|styleNoLabel);

_SECTION_BEGIN("BIG SYMBOL TEXT in BAKGROUND");
GfxSetOverlayMode(1);
//GfxSelectFont("Tahoma", Status("pxheight")/6 );
GfxSelectFont("Ariel", 16, 700 ); 
GfxSetTextAlign( 6 );// center alignment
GfxSetTextColor( ColorRGB( 20, 20, 20 ) );
GfxSetBkMode(1); // transparent
GfxTextOut( Name(), Status("pxwidth")/2, Status("pxheight")/8 );

Filter = C <25 AND C >2 AND Volume > 100000 AND C> Ref(C,-1)AND PDI (14)> MDI(14);

Result = WriteIf(Buy,"Buy","Sell");
AddTextColumn( WriteIf(Buy, "Buy" , "Sell" ) , "TRADE" ,  5 ,   IIf(Buy,colorYellow, colorWhite), IIf(Buy, colorDarkGreen, colorDarkRed) );
AddTextColumn(IndustryID(1) ,"     Industry Sector      ", 25.0, colorWhite, colorBlue);
AddColumn( Close, "Close", 1.2, IIf( ROC(C, 1 ) >= 0, colorBlack,colorRed),50);
AddColumn(Ref(Close,-1),"Y-Close",1.2, IIf( ROC(Ref(C,-1),1)>=0,colorDarkGreen, colorRed ),50 );
AddColumn( Volume, "Volume", 10.0, IIf( ROC(V, 1 ) >= 0,colorBlack,colorRed),49);
AddColumn( ROC( Close, 1 ), "ROC(1)", 1.2, IIf( ROC(C, 1 ) >= 0,colorDarkGreen,colorRed),51);
Previous
Next Post »