I did try this but it returns a constant zero figure:
res = iCustom(Symbol(),Period(),theAtrPeriod,PRICE_OPEN,shift);Antony
Does this indicator operate on price_close? if so can it be made to work on price_open?
double Atr(int shift){ double res; int theAtrPeriod; if(Period() >= PERIOD_M5 && Period() <= PERIOD_M30) theAtrPeriod = AtrPeriod2; if(Period() >= PERIOD_H1) theAtrPeriod = AtrPeriod3; if(Period() >= PERIOD_M1 && Period() < PERIOD_M5) theAtrPeriod = AtrPeriod; res = iATR(Symbol(),Period(),AtrPeriod,shift); return(NormalizeDouble(res,Digits)); return(res); }
Thanks
Antony
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
Hi
I have an EA that uses ATR:
I have comments on the chart showing what the EA is seeing, I have found that sometimes the EA misses a trade because it was showing a very slightly different atr value but just enough to cause a missed tried, could anyone help explain why this maybe? Please note I am not an experienced coder but I like to have a go.
Thanks
Antony