- New MetaTrader 4 Platform build 1045
- Strategy Tester Mystery
- Sleep function in Strategy Tester
Thanks for the feedback guys.
I have decided to rather code the time-events I want by making use of the TimeLocal() function.
Hope it will work for me. Just worried about the resources it is going to take.
Can anybody guide me in finding an acceptable solution for my need to read the price every so many seconds and put the price that is read in an array every time?
Hopefully a solution that can be tested in the Strategy Tester.
ernest02: Can anybody guide me in finding an acceptable solution for my need to read the price every so many seconds and put the price that is read in an array every time?
| This isn't your first post. You should be able to code that simple thing. learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem. |
WHRoeder I did not want anybody to code the EA for me - just to guide me to which functions should preferably be used.
The EventSetTimer(), onTimer(), the Sleep() and the TimeLocal() functions seem not supported by the Strategy Tester. So I was wondering what was left.
Is that too much too ask?
ernest02: Is that too much too ask?
| learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem. |
Was that so hard that you couldn't even attempt it? | ernest02: Can anybody guide
me in finding an acceptable solution for my need to read the price every
so many seconds and put the price that is read in an array every time? Just typed static datetime lastTime=0; static double prices[]; datetime now = TimeCurrent(); if( now > lastTime + SoManySeconds){ lastTime = now; int size = ArraySize(prices); ArrayResize(prices, size + 1); prices[size] = Bid; }Just typed |
WHRoeder I see you have a good heart after all! :-) Thank you for the code snippet.
It may be of interest to you that I am not a programmer but only a tinkerer with MQL4 to be able to test my systems and theories in a short period of time.
I am 72 years of age, but are still trying to do the things you young guys find so easy.
So THANK YOU very much for that help. You have most probably saved me hours or even days of frustration.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use