You want a 14 period of the ATR. Generate it each bar:
#define EMAperiodATR 14 int start(){ static datetime Time0; bool newBar = Time0 < Time[0]; if (newBar){ Time0 = Time[0]; double EMAalphaATR = 2.0/(EMAperiodATR+1), ATR = iATR(NULL, 0, ATR.Period, 1); static double EMA.ATR; EMA.ATR += (ATR - EMA.ATR) * EMAalphaATR; } ...
Wow, and this will be the EMA14 of the ATR?
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
In an EA, how can you add an EMA to the ATR, because ATR is very low like .0004 and EMA is obviously much higher. Is there a way to put the EMA inside the ATR??
I am trying to create an EA for this strategy:
https://www.mql5.com/go?link=http://forex-strategies-revealed.com/advanced/30min-atr-breakout