.

Dual Support System Line Chart - Amibroker AFL Code

Click Image To Enlarge. Please Rate And Comment.

Dual Support System Line Chart

_SECTION_BEGIN("xtl");
tgt = 35;
a = CCI(20) < -tgt;
b = CCI(20) > tgt;
state = IIf(a>b,-1,IIf(a==b,0,1));
Color = IIf(state == 0, colorWhite, IIf(state == 1, colorLime, IIf(state == -1, colorRed, 0)));

//Plot(state, "", color, styleHistogram);

SetChartOptions( 0, chartShowDates | chartShowArrows | chartLogarithmic | chartWrapTitle );
_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", color, styleNoTitle |styleBar ); 
 
_SECTION_END();


Plot( Ref(MA(H,6),-4), _DEFAULT_NAME(), colorWhite, styleThick);
Plot( Ref(MA(L,6),-4), _DEFAULT_NAME(), colorWhite, styleThick);
_SECTION_END();
Previous Post Next Post