Conversion of ATR Pips in MT4 to MT5
- Help in conversion of mql4 code to mql5
- Help converting MQL4 Indicator
- indexing difference between mql4 and mql5.
There are a lot of things to go into, but if you modify the way you calculate ATR, you might be a little closer to the goal.
https://www.mql5.com/en/docs/indicators/iatr
The important part of the linked sample program is the following.
handle=iATR(name,period,atr_period); CopyBuffer(ind_handle,0,0,amount,values)
- www.mql5.com
double … percentSL * (iATR(Symbol(),PERIOD_CURRENT,periods)));
Perhaps you should read the manual, especially the examples.
How To Ask Questions The Smart Way. 2004
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.
Technical Indicators - Reference on algorithmic/automated trading language for MetaTrader 5
Timeseries and Indicators Access / CopyBuffer - Reference on algorithmic/automated trading language for MetaTrader 5
How to start with MQL5 - General - MQL5 programming forum - Page 3 #22 2020.03.08
How to start with MQL5 - MetaTrader 5 - General - MQL5 programming forum - Page 7 #61 2020.07.05
How to call indicators in MQL5 - MQL5 Articles 12 March 2010