Nguyen Thanh Ha:
I am taking ATR values from TF D1 and using them for SL-TP data but when running it again I get error quote!!!!
would of course be useful if you said what error you get!
assuming this is MT5, then you need to read the manual because iATR returns a handle for use with copybuffer where you get the actual values.

Documentation on MQL5: Technical Indicators / iATR
- www.mql5.com
The function returns the handle of the Average True Range indicator. It has only one buffer. Parameters symbol [in] The symbol name of the security...
like Paul said, iATR doesn't return any ATR value, it returns a handle code.
Think twice about using AI instead of the documentation lol
ATR14 = NormalizeDouble(iATR(Symbol(),PERIOD_D1,ATR14_Period,1),4);
That is a MT4 call. Which language are you using?
Why did you post your code question in the MT5 General section instead of the MQL4 section, (bottom of the Root page) or in the MT5 EA section?
General rules and best pratices of the Forum. - General - MQL5 programming forum? (2017)

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
I am taking ATR values from TF D1 and using them for SL-TP data but when running it again I get error quote!!!!