@Bhulokeshwar
I am new to Amibroker. I see here that EMA periods are hardcoded into the script. In such a case, if one wants to optimize the EMA parameters, would one be able to do that, using Amibroker optimization button?
Is it possible to have a dialog box for keying in values for different EMAs and having these values as default? Such dialog box to be part of chart/script/initialization etc.?
Very nice to see experienced programmers fulfilling newbies requests. I hope that I shall be able to do the same for someone, someday!
@yogesh-tiwari
How have you found this strategy in 1. Manual Trading 2. Back-Testing the AFL 3. Trading using AFL signals in paper and real trading?
I am new to Amibroker. I see here that EMA periods are hardcoded into the script. In such a case, if one wants to optimize the EMA parameters, would one be able to do that, using Amibroker optimization button?
Is it possible to have a dialog box for keying in values for different EMAs and having these values as default? Such dialog box to be part of chart/script/initialization etc.?
Very nice to see experienced programmers fulfilling newbies requests. I hope that I shall be able to do the same for someone, someday!
@yogesh-tiwari
How have you found this strategy in 1. Manual Trading 2. Back-Testing the AFL 3. Trading using AFL signals in paper and real trading?
dear yogesh,good luck,i am giving complete afl as u required.do u want audible alarm also?
////////////////////////////////////////////
_SECTION_BEGIN("EMA CROSSOVER CHART");
LongPer = Param("Long Period", 13, 30, 100, 5);
ShortPer = Param("Short Period", 34, 30, 100, 5);
LongPer1 = Param("Long Period1", 3, 30, 100, 5);
ShortPer1 = Param("Short Period1", 5, 30, 100, 5);
LongMA = EMA(C, LongPer);
ShortMA = EMA(C, ShortPer);
LongMA1 = EMA(C, LongPer1);
ShortMA1 = EMA(C, ShortPer1);
LastHigh = HHV(H, LongPer);
GraphXSpace = 10;
Plot(LongMA, " EMA(C, " + WriteVal(LongPer, 1) + ")", colorBrightGreen, styleLine);
Plot(ShortMA, " EMA(C, " + WriteVal(ShortPer, 1) + ")", colorRed, styleLine);
Plot(LongMA1, " EMA(C, " + WriteVal(LongPer1, 1) + ")", colorBlue, styleLine);
Plot(ShortMA1, " EMA(C, " + WriteVal(ShortPer1, 1) + ")", colorBrown, styleLine);
Buy = Cross(LongMA, ShortMA);
Short = Cross(ShortMA, LongMA);
Cover = Cross(LongMA1, ShortMA1);
Sell = Cross(ShortMA1, LongMA1);
PlotShapes(shapeUpArrow * Buy, colorBrightGreen, 0, L, - 10);
PlotShapes(shapeDownArrow * Short, colorRed, 0, H, - 10);
PlotShapes(shapeUpArrow * Cover, colorBlue, 0, L, - 10);
PlotShapes(shapeDownArrow * Sell, colorBrown, 0, H, - 10);
Filter=Buy OR Sell;
Filter=Short OR Cover;
Sell=ExRem(Sell,Buy); Buy=ExRem(Buy,Sell);
Short=ExRem(Short,Cover); Cover=ExRem(Cover,Short);
AddColumn(Buy,"Buy");
AddColumn(Sell,"sell");
AddColumn(Short,"short");
AddColumn(Cover,"cover");
AddColumn(BuyPrice,"BuyPrice");
AddColumn(SellPrice,"SellPrice");
AddColumn(ShortPrice,"shortPrice");
AddColumn(CoverPrice,"coverPrice");
_SECTION_END();
////////////////////////////////////////////
_SECTION_BEGIN("EMA CROSSOVER CHART");
LongPer = Param("Long Period", 13, 30, 100, 5);
ShortPer = Param("Short Period", 34, 30, 100, 5);
LongPer1 = Param("Long Period1", 3, 30, 100, 5);
ShortPer1 = Param("Short Period1", 5, 30, 100, 5);
LongMA = EMA(C, LongPer);
ShortMA = EMA(C, ShortPer);
LongMA1 = EMA(C, LongPer1);
ShortMA1 = EMA(C, ShortPer1);
LastHigh = HHV(H, LongPer);
GraphXSpace = 10;
Plot(LongMA, " EMA(C, " + WriteVal(LongPer, 1) + ")", colorBrightGreen, styleLine);
Plot(ShortMA, " EMA(C, " + WriteVal(ShortPer, 1) + ")", colorRed, styleLine);
Plot(LongMA1, " EMA(C, " + WriteVal(LongPer1, 1) + ")", colorBlue, styleLine);
Plot(ShortMA1, " EMA(C, " + WriteVal(ShortPer1, 1) + ")", colorBrown, styleLine);
Buy = Cross(LongMA, ShortMA);
Short = Cross(ShortMA, LongMA);
Cover = Cross(LongMA1, ShortMA1);
Sell = Cross(ShortMA1, LongMA1);
PlotShapes(shapeUpArrow * Buy, colorBrightGreen, 0, L, - 10);
PlotShapes(shapeDownArrow * Short, colorRed, 0, H, - 10);
PlotShapes(shapeUpArrow * Cover, colorBlue, 0, L, - 10);
PlotShapes(shapeDownArrow * Sell, colorBrown, 0, H, - 10);
Filter=Buy OR Sell;
Filter=Short OR Cover;
Sell=ExRem(Sell,Buy); Buy=ExRem(Buy,Sell);
Short=ExRem(Short,Cover); Cover=ExRem(Cover,Short);
AddColumn(Buy,"Buy");
AddColumn(Sell,"sell");
AddColumn(Short,"short");
AddColumn(Cover,"cover");
AddColumn(BuyPrice,"BuyPrice");
AddColumn(SellPrice,"SellPrice");
AddColumn(ShortPrice,"shortPrice");
AddColumn(CoverPrice,"coverPrice");
_SECTION_END();