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.
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.
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.
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.
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.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
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?