From what I understand, the ticks option in the drop down testing box is the most accurate option to test on.
However I introduce random lags in my program of 1 - 10 minutes, this also helps with demo testing as lag from a live server can be a few minutes.
If your program can stand up to several minute halts before it gets new information to work with, its going to be more robust when you go live is my thinking.
From what I understand, the ticks option in the drop down testing box is the most accurate option to test on.
However I introduce random lags in my program of 1 - 10 minutes, this also helps with demo testing as lag from a live server can be a few minutes.
If your program can stand up to several minute halts before it gets new information to work with, its going to be more robust when you go live is my thinking.
What you mean as introducing random lags, can you give some examples?
What you mean as introducing random lags, can you give some examples?
Sure, this isn't what I use as I have coded my own function for it but this should work:
CurrentTimeVariable = TimeMinute(TimeCurrent());
// Then some code to count down against the random number every minute, finally when:
if (CurrentTimeVariable >= LastTimeVariable + YourVariable )
{
---- Inside Main Code-----
LastTimeVariable = CurrentTimeVariable;
---- End of Program---
YourVariable = MathRand()%6;
// That should indicate from 0 - 5 minutes lag, I use 3 - 10 myself for really laggy testing.
}
LastTimeVariable should be initialised at 0 of course when you start each hour in this example. I use a combination of all the time functions in all my code to get more helpful format for long range orders, so I reset mine every month usually.
More on Random number functions here if my code for it is off
https://www.mql5.com/en/articles/1496
Sorry for the edit, that looks better.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
I am new to MQL, I am confused about accuracy of back tests. Here this part I'm copying from user guide, in strategy testing part of trade platform :
And, also not for just for back testing, I'm looking to some mql4 examples, they are using generally bars for calculations. Is there any way to use ticks in my programs? if yes for back testing is there any accurate data for really accurate tests?
Thanks.