Hi, I have the exact same issue as Douglas with iTime; for example "iTime(XPDUSD,5) Failed: 0".
I am trying using the strategy tester on a 1H tf and call a custom indicator to return a value based on the 5 min tf of the same XPDUSD chart the tester is running on.
The indicator then returns an empty value and this is in the line after I try to download history with the result of "iTime(XPDUSD,5) Failed: 0" but sometimes iTime does not fail, irregularly, and the indicator now has history to then actually return a value.
I have tried both the code suggested by Petr Nosek & whroeder1 but with the same result unfortunately.
Could I be missing something obvious or is this a common problem when running strategy tester with icustom calls on separate time-frames ?
Having a hard time finding better threads about the topic other then this where you all have provided great info.
I'm facing a similar problem so I thought I'd post it here. I'm trying to get the previous value for the current symbol and timeframe for an EA. The EA is executing an indicator I have created. While the indicator is working perfect the EA is 100% wrong.
The EA always returns the current price for Close[i] and Close[i+1], or iClose(_Symbol, 0, i) and iClose(_Symbol, 0, i + 1)
Top window is from the Indicator (you can see the Close is the price of the next row
and bottom window is from the EA where the prices are the same:
Here's the code:
Close[i + 1]
...While the indicator is working perfect the EA is 100% wrong.
My guess is that i is pointing to some place in the past, probably night hours. Why do you even use i when you are just concerend with Close and Close? Try i=0; or remove it entirely from your printf statement, then check again.
Thank you for your reply,
I've tried that as well. Does not work. The dates are valid - you can see them on the left and this goes on for any date! Close is always the same value as Close.
I don't have much experience with MQL, so I was wondering if this is the way that EAs are supposed to work.
I appreciate the response. I did just that and now everything seems to work just fine. Every platform something new to learn.
Thanks again for your response.