EMA Magic Trend Detector



EMA Magic Trend Detector
EMA Magic Trend Detector


//www.aflcode.com
SetChartOptions(0, chartShowArrows | chartShowDates);
FastMAColor = ParamColor("Fast Group MA Color", colorGreen);
SlowMAColor = ParamColor("Slow Group MA Color", colorRed);

ShortEMAAVG = (EMA(C, 3) + EMA(C, 5) + EMA(C, 8)+ EMA(C, 10)+ EMA(C, 12)+ EMA(C, 15))/6;
LongEMAAVG = (EMA(C, 30) + EMA(C, 35) + EMA(C, 40)+ EMA(C, 45)+ EMA(C, 50)+ EMA(C, 60))/6;
 
Plot(EMA(C, 3), "EMA3", colorBlue, styleLine);
Plot(EMA(C, 5), "EMA5", FastMAColor, styleLine);
Plot(EMA(C, 8), "EMA8", FastMAColor, styleLine);
Plot(EMA(C, 10), "EMA10", FastMAColor, styleLine);
Plot(EMA(C, 12), "EMA12", FastMAColor, styleLine);
Plot(EMA(C, 15), "EMA15", FastMAColor, styleLine);
Plot(ShortEMAAVG, "Short EMA Average", colorAqua, styleDashed);
 
Plot(EMA(C, 30), "EMA30", SlowMAColor, styleLine);
Plot(EMA(C, 35), "EMA35", SlowMAColor, styleLine);
Plot(EMA(C, 40), "EMA40", SlowMAColor, styleLine);
Plot(EMA(C, 45), "EMA45", SlowMAColor, styleLine);
Plot(EMA(C, 50), "EMA50", SlowMAColor, styleLine);
Plot(EMA(C, 60), "EMA60", SlowMAColor, styleLine);
Plot(LongEMAAVG, "Long EMA Average", colorPink, styleDashed);


Filter = (ShortEMAAVG >= LongEMAAVG) AND Volume > 100000;    // Volume di atas 1,000 lots
AddColumn(EMA(C,3), "EMA 3",1.2);
AddColumn(EMA(C,5), "EMA 5",1.2);
AddColumn(EMA(C,8), "EMA 8",1.2);
AddColumn(EMA(C,10), "EMA 10",1.2);
AddColumn(EMA(C,12), "EMA 12",1.2);
AddColumn(EMA(C,15), "EMA 15",1.2);
AddColumn(EMA(C,30), "EMA 30",1.2);
AddColumn(EMA(C,35), "EMA 35",1.2);
AddColumn(EMA(C,40), "EMA 40",1.2);
AddColumn(EMA(C,45), "EMA 45",1.2);
AddColumn(EMA(C,50), "EMA 50",1.2);
AddColumn(EMA(C,60), "EMA 60",1.2);
AddColumn(Open, "Open",1.0);
AddColumn(High, "High",1.0);
AddColumn(Low, "Low",1.0);
AddColumn(Close, "Close Price",1.0);
AddColumn((Volume/100), "Volume (Lot)",1.0);

Previous
Next Post »