Why can't I access PERIOD_W1 data in backtesting?

 
iHigh(Symbol(),PERIOD_W1,1); // returns zero in backtesting

Why does the above function return zero in backtesting but the correct value in real time testing? Is it a platform limitation? Or is it something specific to my local installation? I would assume the latter as I seem to recall using this function in backtesting without any issues. Has anyone else run into this problem?

Any advice into what I should be looking?

I tried keeping a W1 chart open. No game. I deleted the W1 hst file, restarted the platfrom, still no game. What am I doing wrong?

 
https://www.mql5.com/en/articles/1512. "Weekly, monthly, and irregular timeframes are not tested". <<Yeah, thats the reason. Sometimes one does sooo many tests that we forget what we recall. ;)
 
Hmm.... I can swear I was running the same expert last week on H1 calling iHigh(Symbol,PERIOD_W1,1) and was working fine... Weird.
 
ubzen:
https://www.mql5.com/en/articles/1512. "Weekly, monthly, and irregular timeframes are not tested". <<Yeah, thats the reason. Sometimes one does sooo many tests that we forget what we recall. ;)

Does this mean the EA does not have access to W1 or does it mean that W1 can't be the timeframe under test ? I think it means the latter.

HerrHimmler:
Hmm.... I can swear I was running the same expert last week on H1 calling iHigh(Symbol,PERIOD_W1,1) and was working fine... Weird.

Do you have W1 data for the date range you are trying to test ? look at that date range on a W1 chart.

 
I believe the article above is talking about the fact that you can't test on W1, not that you can't access W1 data while testing on H1 for example. I just tried the same piece of code on a different broker and it works fine... Can't tell why one works and the other does not though. Any ideas?
 
RaptorUK:

Do you have W1 data for the date range you are trying to test ? look at that date range on a W1 chart.

Yes, I'm testing on very recent data, last week only.
 
HerrHimmler:
Yes, I'm testing on very recent data, last week only.

OK, but do you actually have the required W1 data ? if you want to check in a non destructive way open the History Center, find the symbol you are testing, click Weekly and see what is the most recent data you have . . . in my GBPUSD data the newest W1 data I have is from March.
 
RaptorUK:
OK, but do you actually have the required W1 data ?


Yes. History center shows Weekly data going back to '93. And there are no gaps in the data, at least the most recent one that I'm testing. I can also open a W1 chart and the data is there. I also deleted the .hst file, restarted the platform, and tried again. Still no dice.
 
HerrHimmler:
Hmm.... I can swear I was running the same expert last week on H1 calling iHigh(Symbol,PERIOD_W1,1) and was working fine... Weird.

Humm, sorry lol ... I believe you guys are correct. Perhaps you just don't have the weekly data then. Re_convert your m1_data into weekly for the time_range you're trying to test.

Added: Your code works for me... [if thats any consolation].

 

It certainly acts as if there's no data available but the data is there. History center shows me the data and the .hst files are there. It will not work however on any of the symbols no matter what. It's funny that it was actually working a few days back. I suspect there's some sort of corruption in the files somewhere for this broker's installation. Will try an reinstall and see what happens. Other brokers seem to work fine.

It's too bad that even my client has the same kind of problem. I have a feeling I'll have to give up on the PERIOD_W1 and loop through PERIOD_D1 to get my highs and lows.

PS: the broker it's not working on is alpari uk. it's working on ibfx demo and varengold demo.

 
If you do reinstall, do-not install under Program_Files, for Windows 7/8/Vista. I install my mt4 on the root of C:\Meta_Trader. Uac_Issue. There are also may such links about UAC issues and you can search the forum for more. In general we advise people not-to install in Program_files.
Reason: