Saturday 4 July 2015

Make Decision on This Afl for Amibroker




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



SetChartOptions(0,chartShowArrows|chartShowDates);

Plot( C, "close", ParamColor("color", colorBrightGreen), styleNoTitle | ParamStyle("style") | GetPriceStyle() );
_SECTION_BEGIN("tfs-rsi");
fast=Param("rsi per",14,3,20,1);
TimeFrameSet(in15Minute*2);
f460=RSI(fast);
TimeFrameRestore();
up460=TimeFrameExpand(f460,in15Minute*2,expandFirst);
up4h=up460>50;
dn4h=up460<50;
co460=IIf(up4h,colorBlue,IIf(dn4h,colorRed,colorBlack));
TimeFrameSet(inHourly);
fd=RSI(fast);
TimeFrameRestore();
updy=TimeFrameExpand(fd,inHourly,expandFirst);
upd=updy>50;
dnd=updy<50;
cod=IIf(upd,colorBlue,IIf(dnd,colorRed,colorBlack));
TimeFrameSet(inDaily);
fw=RSI(fast);
TimeFrameRestore();
upwy=TimeFrameExpand(fw,inDaily,expandFirst);
upw=upwy>50;
dnw=upwy<50;
cow=IIf(upw,colorBlue,IIf(dnw,colorRed,colorBlack));
ups=(up4h AND upd AND upw);
dns=(dn4h AND dnd AND dnw);
_SECTION_END();

_SECTION_BEGIN("font color");
function gfxconvertbartopixelx(bar)
{
lvb = Status("lastvisiblebar"); fvb = Status("firstvisiblebar");
pxchartleft = Status("pxchartleft"); pxchartwidth = Status("pxchartwidth");
return pxchartleft + bar * pxchartwidth / (lvb-fvb + 1);
}
procedure multiribbon(ribboncolor, position, label)
{
linecolor =colorWhite;
position =2* position;
x2 = Status("pxchartright");
y2 = Status("pxchartbottom");
ribboncolor =IIf(gfxconvertbartopixelx(BarIndex()-Status("firstvisiblebarindex")) > y2/1.5 *
(2/100)*10,ribboncolor, colorYellow);
Plot(0, "",linecolor, styleOwnScale|styleNoLabel,0,100);
Plot(position, "",linecolor,styleOwnScale| styleNoLabel,0,100);
Plot(position, "",ribboncolor,styleArea|styleOwnScale|styleNoLabel, 0,100);
GfxSetTextColor(colorBlack);
GfxSelectFont("arial", y2/1 * (2.7/180),200);
GfxDrawText(label,8, y2 *1.006-(y2 * position/100) , y2/1.6*
(2/100)*10,y2,2+32+256);
}
multiribbon(co460,1, "30 Minute");
multiribbon(cod,2, "1 Houre");
multiribbon(cow,3, "1 day");
_SECTION_END();
SetChartBkColor( ParamColor("background",colorBlack));

Buy=up4h AND upd AND Cross(RSI(14),50);
Sell=dn4h AND dnd AND Cross(50,RSI(14));
PlotShapes(IIf(Buy,shapeSmallUpTriangle,shapeNone),colorCustom12,0,L,-40);
PlotShapes(IIf(Sell,shapeSmallDownTriangle, shapeNone),colorCustom12,0,H,-40);

_SECTION_BEGIN("AuthorName");
k = (GetPerformanceCounter()/100)%100;
printf("GetPerformance Counter %g",k);
GfxSelectFont("jokerman", 14,800);
GfxSetBkMode(1);
GfxSetTextColor(colorWhite);

RequestTimedRefresh(10);
_SECTION_END();

No comments:

Post a Comment

Thanks