_SECTION_BEGIN("Macd Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g,
Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
//MACD
r1 = Param( "Impulse Fast avg", 12, 2, 200, 1 );
r2 = Param( "Impulse Slow avg", 26, 2, 200, 1 );
r3 = Param( "Impulse Signal avg", 9, 2, 200, 1 );
ml = MACD(r1, r2);
sl = Signal(r1,r2,r3);
MACUP = sl < ml AND ml > 0;
MACDN = sl > ml AND ml < 0;
SetBarFillColor (IIf(MACUP,colorGreen,IIf(MACDN, colorRed,colorBlack)));
Plot( C, "Price", IIf(MACUP,colorGreen,IIf(MACDN, colorRed,colorBlack)) , styleNoTitle | ParamStyle("Style") |
GetPriceStyle() );
_SECTION_END();