Sunday 17 May 2015

High Low Bracket for Amibroker (AFL) with Audio Sound

High Low Bracket for Amibroker (AFL)








HX=Ref(H,-1);
LX=Ref(L,-1);
TicksOffset= Param("TicksOffset",0.0001,0.0001,0.50,0.0001);
y0=LastValue(HX)+TicksOffset;
y1=LastValue(LX)-TicksOffset;
Offset = 2;
for(i=BarCount-2;i>1;i--)
{
bars = i;
i = 0;
}
Plot(LineArray(bars-Offset, y0, BarCount, y0,1), "", colorDarkRed, styleLine|styleLine|styleNoLabel, Null, Null, Offset);
Plot(LineArray(bars-Offset, y1, BarCount, y1,1), "", colorDarkRed, styleLine|styleLine|styleNoLabel, Null, Null, Offset);
for (i=bars; i <BarCount;i++)
{
if (C[i]>y0)
color[i]=colorBlue;
else
color[i] = Null;
PlotText(""+Y0, BarCount+1,Y0,Null,color[i]);
AlertIf( C[i]>y0, "SOUND C:\\Windows\\Media\\ringout.wav", "Audio alert", 1 );
}
for (i=bars; i <BarCount;i++)
{
if (C[i]<y1)
color[i]=colorRed;
else
color[i] = Null;
PlotText(""+Y1, BarCount+1,Y1,Null,color[i]);
AlertIf( C[i]<y1, "SOUND C:\\Windows\\Media\\ringout.wav", "Audio alert", 1 );
}

_SECTION_BEGIN("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 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();

No comments:

Post a Comment

Thanks