I have been testing an EA using "Daily" period for July 2016. My EA needs the current market price in order to make buy/sell decisions and it works that price out by signing Bid to a variable after using RefreshRates(). In addition, my EA takes the high and low of the last hourly bar (after working out if it is a new hourly bar or not) using iHigh(NULL,PERIOD_H1,1) and assigns those to two variables then prints them. The hourly high and low in the EA agree precisely with High and Low on the Data Window so I think are correct. However I have tried printing the current price variable with Bid assigned to it (a lot of data even for 3 days) and the results show that the price being assigned to it cannot possibly be correct, for example none of the prices recorded in the current price variable were between the hourly high/low during the whole of that morning, let along during that hour! However the current price variable did rise to somewhere between the hourly high/low later that day (although by that time the bars on the chart had changed again of course).
I have checked that my time settings on the PC are current and in the correct time zone and I don't seem to be getting the problem when running the EA live. However the Tester is obviously producing incorrect and very misleading and unusable results. Is there some reason why the Tester is getting the current Bid price very wrong?
You have not shown your code, so we cannot check it for bugs!
When testing multi-timeframe EA, the strategy tester gets is current time-frame data from the FXT files, but for other time-frames it gets it from the HST files. If these mismatch and are not in sync and consistent with each other, you will get discrepancies. So, to clarify, please answer the following:
Is your FXT data being produced by MetaTrader or are you using a 3rd party tool like TickStory.If your data is being produced by MetaTrader, are then any "mismatch" errors/warnings in the journal/log when it first runs and produces the FXT files?If yes, there are "mismatch" warnings, then your HST Files (History data) is not in sync and needs to be cleaned up.If your data is being produced by 3rd Party tools, then you must produce both FXT and HST files and make them all read-only, both the FXT and HST files. If you don't do that, then incoming broker data will corrupt the files and cause mismatching data.
Is your FXT data being produced by MetaTrader or are you using a 3rd party tool like TickStory.
I have noticed that sometimes the time in the tester journal is incorrect, I haven't noticed this for a long time though.
Print the bar time to make sure.
No, it is not MT4 that is unstable. I have already stated that if you are getting "mismatch" errors, then your data is not in sync (or corrupt) and you will have to correct that.
Use the "PeriodConverter.mq4" to rebuild clean synced HST files from an M1 base, downloaded from the History Center.
I attached "PeriodConverter.mq4" to the M1 chart and opened the offline chart upon which MT4 crashed!