it can help you
https://www.mql5.com/en/docs/indicators/iatr

Documentation on MQL5: Technical Indicators / iATR
- www.mql5.com
Technical Indicators / iATR - Reference on algorithmic/automated trading language for MetaTrader 5
EugenBenno:
I have the same problem. Do you know at this tiem how to manage the lack of the shift in the functions?
I have the same problem. Do you know at this tiem how to manage the lack of the shift in the functions?
In MQL5, iATR (and any of the i... indicator functions) returns an int handle. You need to apply this handle to the CopyBuffer() function, see documentation link. Here you will also specify the shift.

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
Hello,
How can I write this MQL4 code in MQL5?
for(int r=1; r<11 ; r++)
ATR_SUM=ATR_SUM+(iATR(Symbol(),Period(),14,r));
ATR_TP=(ATR_SUM/10);
in MQL4 there is shift parameter which is not on MQL5!
MQL4:
double iATR(
string symbol, // symbol
int timeframe, // timeframe
int period, // averaging period
int shift // shift
);
MQL5:
int iATR(
string symbol, // symbol name
ENUM_TIMEFRAMES period, // period
int ma_period // averaging period
);