Skip to main content

EMA CROSSOVER for Amibroker (AFL)

sudesh about 16 years ago Amibroker (AFL)

  • Rating:
    5 / 5 (Votes 3)
  • Tags:
    trading system, amibroker, optimize

Works fine with 30 min chart. Also includes optimizations of the crossover periods for fine tuning.

Indicator / Formula

Copy & Paste Friendly
// EMA Cross
Range1=Optimize("range1",7,1,20,1);
Range2=Optimize("range2",7,1,20,1);
Plot( Close, "Price", colorBlack, styleCandle ); 
Plot(EMA( Close,range1), "7d-ema", colorRed );  
Buy = Cross((Close),(EMA(Close,range1))); 
Buystop = Ref(EMA(Close,range1),-1); 
BuyPrice = Max(Buystop,Low); 
Sell = Cross(EMA(Close,range2),(Close)); 
Sellstop = Ref(EMA(Close,range1),-1); 
SellPrice = Min(sellstop,High); 
Short = Sell; 
Cover = Buy; 

0 comments

Leave Comment

Please login here to leave a comment.