Click Image To Enlarge. Please Rate And Comment.
_SECTION_BEGIN("EMA CROSSOVER CHART");
LongPer = Param("Long Period", 5, 30, 100, 5);
ShortPer = Param("Short Period", 10, 30, 100, 5);
LongMA = EMA(C, LongPer);
ShortMA = EMA(C, ShortPer);
LastHigh = HHV(H, LongPer);
GraphXSpace = 10;
Plot(LongMA, " EMA(C, " + WriteVal(LongPer, 1) + ")", colorDarkBlue, styleLine);
Plot(ShortMA, " EMA(C, " + WriteVal(ShortPer, 1) + ")", colorRed, styleLine);
Buy = Cross(LongMA, ShortMA);
Sell = Cross(ShortMA, LongMA);
PlotShapes(shapeUpArrow * Buy, colorBrightGreen, 0, L, - 10);
PlotShapes(shapeDownArrow * Sell, colorRed, 0, H, - 10);
AlertIf(Buy, "SOUND C:\\Windows\\Media\\buglehorn.wav", "Buy Triggered!", 1, 8);
AlertIf(Sell, "SOUND C:\\Windows\\Media\\buglehorn.wav", "Sell Triggered!", 2, 8);
Filter=Buy OR Sell;
Sell=ExRem(Sell,Buy); Buy=ExRem(Buy,Sell);
AddColumn(Buy,"Buy");
AddColumn(Sell,"sell");
AddColumn(BuyPrice,"BuyPrice");
AddColumn(SellPrice,"SellPrice");
_SECTION_END();