Plus Directional Movement Breakout System for Amibroker (AFL)
nbkblr almost 15 years ago Amibroker (AFL)
Hi,
I got this from a blog, seems good
Indicator / Formula
Copy & Paste Friendly
_SECTION_BEGIN("Plus Directional Movement Breakout System");
periods = Param("Periods", 14, 2, 200, 1);
pChange = Param("% Change", 5, 0.1, 10, 0.1);
pdiVal = PDI(periods);
pdiPeak = Peak(pdiVal, pChange, 1);
pdiTrough = Trough(pdiVal, pChange, 1);
Buy = Cross(PdiVal, Ref(ValueWhen(pdiPeak != Ref(pdiPeak, -1), pdiVal, 1), -1));
Sell = Cross(Ref(ValueWhen(pdiTrough != Ref(pdiTrough, -1), pdiVal, 1), -1), pdiVal);
Buy = Exrem(Buy, Sell);
Sell = Exrem(Sell, Buy);
_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", ParamColor("Price Color", colorBlack ), styleNoTitle | ParamStyle("Price Style") | GetPriceStyle() );
PlotShapes(shapeUpArrow * Buy, colorGreen, 0, L, Offset=-20);
PlotShapes(shapeDownArrow * Sell, colorRed, 0, H, Offset=-20);
_SECTION_END();3 comments
Leave Comment
Please login here to leave a comment.
EROR AFL !!!!!!!!!!!!!!!!!
Working fine for me.
Nice Indicator