Hi
I'm trying to get some take profit targets using iATR in MT4, in normal charts, I can simply use
But when I set the time frame for back test on 1 minute, this code returns 0, I am using tick data that was exported from tick story and I have 5 minute tick data in the history folder, how can I solve this for back testing?
thanks
simple but did you use PERRIOD_CURRENT and / or PERRIOD_M1?
iATR(NULL, PERRIOD_CURRENT , 14, 0)
simple but did you use PERRIOD_CURRENT and / or PERRIOD_M1?
That would give me the current period, I don't want the current period but the periods above the current
That would give me the current period, I don't want the current period but the periods above the current
input ENUM_TIMEFRAMES atrTF = PERIOD_CURRENT; //-- iATR(NULL, atrTF , 14, 0)
Make an input
iATR(NULL, PERIOD_M5, 14, 0)
- On MT4: Unless the current chart is that specific symbol(s)/TF(s) referenced, you must handle 4066/4073
errors before accessing candle/indicator values.
Download history in MQL4 EA - Forex Calendar - MQL4 programming forum - Page 3 #26 № 4 - Don't use bar zero, as you won't have an accurate average. In your case you have (13 valid ranges + zero initially) / 14. Don't you want 14 valid ranges / 14?
- Don't use NULL.
- You can use NULL in place of _Symbol only in those calls that the documentation specially says you can. iHigh does, iCustom does, MarketInfo does not. OrderSend does not.
- Don't use NULL (except for pointers where you explicitly check for it.) Use _Symbol and _Period, that is minimalist as possible and more efficient.
- Zero is the same as PERIOD_CURRENT which means _Period. Don't hard code numbers.
- MT4: No need for a function call with iHigh(NULL,0,s) just use the predefined arrays, i.e. High[].
- On MT4: Unless the current chart is that specific symbol(s)/TF(s) referenced, you must handle 4066/4073
errors before accessing candle/indicator values.
Download history in MQL4 EA - Forex Calendar - MQL4 programming forum - Page 3 #26 № 4 - Don't use bar zero, as you won't have an accurate average. In your case you have (13 valid ranges + zero initially) / 14. Don't you want 14 valid ranges / 14?
All your suggestions are valid except :
1- Even if i get a value that not accurate, it's still acceptable because I'm defining a take profit level using it, so, if it's a point or two inacurate, that is not important.
2- Putting the symbol name did not solve the issue at all
3- As I mentioned multiple times, I have all the real tick data for all the time frames for the dates that I'm trying the back test, it looks like back test engine does not even look for those data at all !

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi
I'm trying to get some take profit targets using iATR in MT4, in normal charts, I can simply use
But when I set the time frame for back test on 1 minute, this code returns 0, I am using tick data that was exported from tick story and I have 5 minute tick data in the history folder, how can I solve this for back testing?
thanks