iATR only works on 1 time frame.

 

Hi, I cannot get the iATR function to work on any time frame (such as 5 min) other than the time frame that is on my chart (1 minute chart), when I applied it to GBPUSD.

However it did work on other time frame settings (such as 5 min) when I applied it a EURCHF 1 min chart.

Both charts were 1 minute bar charts. Below I have two iATR's that I put on a print function so you can see that only the 1 minute setting works on this GBPUSD chart.

Any ideas on why it works on EURCHF but not on GBPUSD?

thanks

int start()
{
 
     //Print(Time[0]);
Print(iATR(NULL,5,800,0)*500000);   
Print(iATR(NULL,1,800,0)*500000);  
return(0);
}


 
moneycode:

Hi, I cannot get the iATR function to work on any time frame (such as 5 min) other than the time frame that is on my chart (1 minute chart), when I applied it to GBPUSD.

However it did work on other time frame settings (such as 5 min) when I applied it a EURCHF 1 min chart.

Both charts were 1 minute bar charts. Below I have two iATR's that I put on a print function so you can see that only the 1 minute setting works on this GBPUSD chart.

Any ideas on why it works on EURCHF but not on GBPUSD?

Perhaps you don't have the M5 data . . . open a M5 chart then re-run your test, then go looking for information about error 4066.
 
RaptorUK:
Perhaps you don't have the M5 data . . . open a M5 chart then re-run your test, then go looking for information about error 4066.


Oh, that does make a bit of sense..

And prior to writing the code I did download a bunch of EURCHF data, but only 1 download on the GBPUSD data. So that would explain why it only worked on EURCHF and not on GBPUSD.

Also I wasn't aware that the iATR required the 5 min bar data, I assumed it calculated all time frames from the 1 min data.

Thanks

 
Yep, that fixed it!
 
moneycode:

Also I wasn't aware that the iATR required the 5 min bar data, I assumed it calculated all time frames from the 1 min data.

Thanks

Nope, that is what MT5 does, MT4 has a .hst file for each timeframe.