Click Image To Enlarge. Please Rate And Comment.
_SECTION_BEGIN("macd HLCby3");
pivot = (H +L+C)/3;
piv1 = EMA (pivot,Param("short ema",5,1,20,1));
piv2 = EMA (pivot,Param("med ema",12,1,20,1));
piv3 = EMA (pivot,Param("fast ema",34,1,50,1));
diff1 = piv2-piv3 ;
diff2 = piv1-piv2 ;
diff3 = piv1-piv3 ;
diff1_col = IIf (diff1 > Ref(diff1,-1),colorBlue,colorRed);
diff2_col = IIf (diff2 > Ref(diff2,-1),colorBlue,colorRed);
diff3_col = IIf (diff3 > Ref(diff3,-1),colorBlue,colorRed);
Buy = diff3 > Ref(diff3,-1);
Short = diff3 < Ref(diff3,-1);
//Plot(diff1, "diff1", diff1_col, styleThick);
//Plot(diff2, "diff2", diff2_col, styleThick);
//Plot (diff3, "diff3", diff3_col, styleThick);
Plot(0,"",colorGrey40);
BBtopcol = IIf (BBandTop( diff3, 5, 0.5 ) > Ref(BBandTop( diff3, 5, 0.5 ),-1),colorBlue,colorRed);
BBbotcol = IIf (BBandBot( diff3, 5, 0.5 ) > Ref(BBandBot( diff3, 5, 0.5 ),-1),colorBlue,colorRed);
//Plot( BBandTop( diff3, 5, 0.5 ), "BBTop", BBtopcol, styleDashed );
//Plot( BBandBot( diff3, 5, 0.5 ), "BBBot", BBbotcol, styleDashed );
Plot( EMA( DIFF3, 2 ),"signal", colorRed, styleThick );
Plot( EMA( diff3,6),"signal2",colorBlue,styleThick);
Plot(3, "ribbon", diff3_col, styleOwnScale| styleArea|styleNoLabel,-0.5,100);
_SECTION_END();