.

Bullish Bearish Cloud Based Buy Sell Arrows - Amibroker AFL Code

Click Image To Enlarge. Please Rate And Comment.

Bullish Bearish Cloud Based Buy Sell Arrows

SL = ( HHV( H, 26 ) + LLV( L, 26))/2; // standard, base, or kijun-sen line
TL = ( HHV( H, 9 ) + LLV( L, 9 ))/2; // turning, conversion, or tenkan-sen line
DL=Ref(C,25 );     // delayed close price, or chikou span
Span1 = Ref( ( SL + TL )/2, -25 );  //Span1 and Span2 define the clouds
Span2 = Ref( (HHV( H, 52) + LLV(L, 52))/2, -25);

CStyle = ParamToggle("Showcandles?","N|Y");//Choose Candle or Line for Price Plot
hue = Param("ue",140,0,255,1);
sat = Param("sat",100,0,255,1);
bri = Param("bri",220,0,255,1);

MaxGraph = 8;
Refline = (Span1 + Span2)/2;
Graph0 = Refline;
Graph0Style = 16;//No line plotted, used as a reference line for arrows etc.
if(Cstyle )
Plot(C,"Price",colorBlue,styleCandle);
else
Plot(Close,"Close",colorBlack,styleThick); 
Plot(SL,"SL",colorBlue,styleThick); 
Plot(TL,"TL",colorBrightGreen,styleThick); 
Plot( DL,"DL",colorViolet,styleLine,styleThick); 
PlotOHLC(Span1,Span1,Span2,Span2,"Cloud",IIf(Span1>Span2,colorBrightGreen,colorRed),styleCloud);

above = IIf(TL>Span1 AND TL>Span2,1,0);
within = IIf((TL>Span1 AND TL<Span2) OR (TL<Span1 AND TL>Span2) ,1,0);
below = IIf(TL<Span1 AND TL<Span2,1,0);
Buy = Cross(TL,SL);
Sell = Cross(SL,TL);
//Buy=ExRem(Buy,Sell);
//Sell=ExRem(Sell,Buy);

StrongBuy = Buy AND above;
MediumBuy = Buy AND within;
WeakBuy = Buy AND below;
StrongSell = Sell AND below;
MediumSell = Sell AND within;
WeakSell = Sell AND above;

IIf( (StrongBuy),PlotShapes(shapeUpArrow*StrongBuy,colorDarkGreen),0);
IIf( (MediumBuy),PlotShapes(shapeUpTriangle*MediumBuy,colorGreen),0);
IIf( (WeakBuy),PlotShapes(shapeHollowUpArrow*WeakBuy,colorIndigo),0);
IIf( (StrongSell),PlotShapes(shapeDownArrow*StrongSell,colorRed),0);
IIf( (MediumSell),PlotShapes(shapeDownTriangle*MediumSell,colorRed),0);
IIf( (WeakSell),PlotShapes(shapeHollowDownArrow*WeakSell,colorBrown),0);
Previous Post Next Post