Skip to main content

Elder's Impulse System Price Chart for Amibroker (AFL)

ippfx about 14 years ago Amibroker (AFL)

  • Rating:
    3 / 5 (Votes 2)
  • Tags:
    amibroker

Elder’s Impulse System

http://stockcharts.com/school/doku.php?id=chart_school:chart_analysis:elder_impulse_system

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("Impulse System Price Chart");
SetChartOptions(0,chartShowArrows|chartShowDates);

r1 = Param( "Fast avg", 12);
r2 = Param( "Slow avg", 26);
r3 = Param( "Signal avg", 9);
period = Param("Period", 13);

ml = MACD(r1, r2);
sl = Signal(r1,r2,r3);
mh = ml - sl;
eh = ROC(MA(C,period),1);
MHtrend = IIf(mh > Ref(mh, -1), 1, -1);
MAtrend = IIf(eh > Ref(eh, -1), 1, -1);

up = MHtrend >0 AND MAtrend >0;
dn = MHtrend <0 AND MAtrend <0;

if (GetPriceStyle() == styleCandle) {
	SetBarFillColor( IIf(C > O, colorWhite, IIf(up, colorSeaGreen, IIf(dn, colorPink, colorLightBlue))));
}
BarColor = IIf(up, colorDarkGreen, IIf(dn, colorRed, colorBlue));

_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", BarColor, styleNoTitle |GetPriceStyle() ); 
_SECTION_END();

1 comments

Leave Comment

Please login here to leave a comment.