//MACD Indicator with colored histogram and 85% peak histogram level indication // Abnash Singh 30 October 2011 // abnash1978@yahoo.co.uk _SECTION_BEGIN("MACD"); r1 = Param( "Fast avg", 12, 2, 200, 1 ); r2 = Param( "Slow avg", 26, 2, 200, 1 ); r3 = Param( "Signal avg", 9, 2, 200, 1 ); Plot( ml = MACD(r1, r2), StrFormat(_SECTION_NAME()+"(%g,%g)", r1, r2), ParamColor("MACD color", colorYellow), ParamStyle("MACD style") ); Plot( sl = Signal(r1,r2,r3), "Signal" + _PARAM_VALUES(), ParamColor("Signal color", colorBlue ), ParamStyle("Signal style") ); //Plot( ml-sl, "MACD Histogram", ParamColor("Histogram color", colorBrightGreen ), ParamStyle("Histogram style", styleHistogram | styleNoLabel, maskHistogram ) ); diff=ml-sl; diffhhv=IIf(diff>0,HHV(diff,10)*.85,Null); diffllv=IIf(diff<0,LLV(diff,10)*.85,Null); Plot(diffhhv,"",colorYellow,styleNoLine|styleDots); Plot(diffllv,"",colorYellow,styleNoLine|styleDots); PlotOHLC( 0,diff , 0 ,9 , "Cloud", IIf(diff>0 ,colorBrightGreen,colorRed), styleCloud|styleNoLabel); _SECTION_END();