+91-0000000000

}

Monday – Friday : 9:00 AM – 6:30 PM

MACD BB Line

MACD BB Line AFL, coupled with an AmiBroker data feed, emphasizes the MACD line within Bollinger Bands. By visualizing the MACD line in relation to Bollinger Bands, it aids traders in assessing potential trend changes or continuations.

/


function fMACDLine(input,fa0, fa1)
{
result = EMA(input,fa0) - EMA(input,fa1);
return result;
}


function fMACDAvg(input,fa0, fa1, fa2)
{
mymacd1 = EMA(input,fa0) - EMA(input,fa1);
result = EMA(mymacd1,fa2);

return result;
}


function fMacdHisto( input, f0, f1, f2 ) 
{ 
mymacd = EMA(input,f0) - EMA(input,f1);
mymacdsig = EMA(mymacd,f2);

result = mymacd - mymacdsig;

return result; 
} 

price = (H+L+C)/3;
MA1 = 7;
MA2 = 10;
MA3 = 5;

MACDHisto = fMacdHisto( price, MA1, MA2, MA3);
MACDHistox2 = fMacdHisto( price, MA1*2, MA2*2, MA3*2);
MACDHistox3 = fMacdHisto( price, MA1*3, MA2*3, MA3*3);
MACDLine = fMacdLine(price, MA1*3, MA2*3);
MacdAvg = fMacdAvg(price, MA1*3, MA2*3, MA3*3);

MACDLineColor = IIf(MACDLine>= Ref(MACDLine,-1), colorWhite, colorViolet );

Plot(MACDLine, "MACDLine", MACDLineColor , styleLine|styleLeftAxisScale|styleThick); 
Plot(MACDAvg, "MACDAvg", colorBlue, styleLine|styleLeftAxisScale); 

Plot(MACDHisto, "MACDHisto", IIf(MACDHisto >=0,colorGreen, colorRed), styleThick | styleHistogram );
Plot(MACDHistoX2, "MACDHistoX2", colorYellow, styleLine | styleStaircase );
Plot(MACDHistoX3, "MACDHistoX3", colorBlack, styleLine | styleStaircase );

PullbackUp = MACDHisto<0 AND MACDHIstox2>0 AND MACDHIstox3>0 AND MACDHisto0 AND MACDHIstox2<0 AND MACDHIstox3<0 AND MACDHisto>Ref(MACDHisto,-1);

Color = IIf( PullbackUp, colorAqua,IIf(PullbackDown, colorPink, colorTeal));

Plot( 1, "", Color, styleArea | styleOwnScale | styleNoLabel , 0, 1);

Open chat
1
Hi, how can I help you?