Hi, I am trying to convert the ATR Pips that I used in MQL4 to the MQL5 language. So far there were no error already on compilation but their is no plot that is being shown when being attached to the MetaTrader. Any help with the code will be greatly appreciated.
- Help in conversion of mql4 code to mql5
- Help converting MQL4 Indicator
- Help add ATR to my code for EA
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)
Documentation on MQL5: Technical Indicators / iATR
- www.mql5.com
//| Demo_iATR.mq5 | //| Copyright 2011, MetaQuotes Software Corp. | //| https://www.mql5.com | "The method of creation of the handle is set through the 'type' parameter (function type...
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
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