Whenever I click "start" my EA usually needs 2 or 3 attempts to run on the Strategy Tester. It uses multiple time frame analysis. The error I'm getting is a zero value at an iAM calculation on the very first bar (which leads to a zero divide since I'm dividing one iMA from another iMA). I have 5 years of full history data from Tickstory and trying the strategy tester with plenty bars in the past for calculation (altough I only use 32 bars for that). Strange thing is that it DOES RUN after 2nd or 3rd try (just click start again). What could be the issue? Anyone?
Whenever I click "start" my EA usually needs 2 or 3 attempts to run. It uses multiple time frame analysis. The error I'm getting is a zero value in an iAM calculation on the very first bar (which leads to a zero divide since I'm diving one iMA from another iMA). I have 5 years of full history data from Tickstory. Strange thing is that it DOES RUN after 2nd or 3rd try (just click start again). What could be the issue? Anyone?
Thank you for reply.
I must say that marking HST as read-only solved the issue for the EURUSD (which I thank you very much for!) but not the SP500. Any clues why the issue was solved marking the HST only for the EURUSD? I must add that I had already disconnected my broker account to prevent overwriting. All the MT4 standard EAs run fine on my history data.
As for the quantity of history bars I do get enough of them, as I said I have 5 years of data and I'm trying the strategy tester with plenty bars in the past for calculation (although I only use 32 bars for that). In fact, I left a full year of history behind to prevent that from happening.
How do I check whether I'm getting errors 4073 or 4066? The log only shows where in the code the zero divide happened (which is at the iMA division) and then it says "Testing pass stopped due to a critical error in the EA".
Thank you a lot!
Thank you a lot!
UPDATE: I've put the EURUSD to run for a long time and in the middle of
the test it gave the bloody error. And restarting the MT4 terminal also
produced the error once again like before, at the very beggining. So
putting the HST files as read-only actually didn't solve the issue at
all. It either runs and stops in the middle or doesn't run at all after 2
or 3 tries.
Thank you once again.
I did what you told me: it is error 4073 (no history data). Well, a couple of comments/questions:
1) Now that I'm printing the error on every iteration (I called "Alert" to check on it) the strategy tester doesn't hang the execution due to a zero divide anymore. I suspect that it has something to do with the fact that I'm somehow pre-loading the data or pre-calculating the iMA. This seems to have the same effect as trying to run it for 2nd or 3rd attempt. What I don't understand is: if the iMA (in the denominator) is indeed zero, then why no zero divide error anymore?
2) I'm executing the code on every tick and the iMA uses shift 1 (last closed candle), hence the 4073 error should happen in EVERY tick that is in theory affected my such missing data. HOWEVER, only one tick in the middle of nowhere has this error - its predecessor and sucessor are ok.
Your help is being much appreciated!
Thank you very much for your help. I'll include a routine to check only the first tick on every candle, not every tick. This will probably solve the problem as there'll be less data access to be made. I'll contact you if I still face problems after that!
To add comments, please log in or register