Stoch in other style for Amibroker (AFL)
skssks207 over 13 years ago Amibroker (AFL)
Stoch indicator in smooth lines.
Indicator / Formula
Copy & Paste Friendly
grid_day = IIf(Day()!=Ref(Day(),-1),1,0);
Plot(grid_day,"",colorDarkGrey,styleHistogram|styleDashed|styleNoLabel|styleOwnScale);
SetChartOptions(0,chartShowArrows|chartShowDates);
d1=StochK(18, 9);//, 18) ;
d2=StochD(18,9,3);//, 20);
qw=WMA(d1, 1); wq=WMA(d2, 1);
ww=WMA(qw, 2); ee=WMA(wq, 2);
p1=WMA(ww, 3); p2=WMA(ee, 3);
Plot(p1, "price", colorDarkGreen);
Plot(p2, "price", colorDarkRed);
Overbought = 80 ;
Oversold =20 ;
Center = 50 ;
Plot(Overbought, "",colorRed) ;
Plot(Oversold, "",colorGreen) ;
Plot(Center, "",colorBlue, styleDashed) ;
Buy=Cross(p1, p2) AND Oversold ;
Sell=Cross(p2, p1) AND Overbought;
Cover=Buy; Short=Sell;
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
BuyPrice=ValueWhen(Buy, C);
SellPrice=ValueWhen(Sell, C);
Filter=Buy OR Sell ;
SetOption("NoDefaultColumns", True);
AddTextColumn(Name(), "Symbol", 77, colorDefault, colorDefault, 120);
AddColumn(DateTime(), "Trigger Date", formatDateTime);
AddColumn(IIf(Buy, 66, 83), "Signal", formatChar, colorYellow, IIf(Buy, colorGreen, colorRed));
AddColumn(IIf(Buy, BuyPrice, SellPrice), "Entry", 6.2);
AddColumn(LastValue(C), "C. M. P.", 6.2);1 comments
Leave Comment
Please login here to leave a comment.
good work
if we trade this indicator with trend direction then it gives really good result.