Optimizing on the fly and backtesting

To add comments, please log in or register
johnmcgiles
35
johnmcgiles  

I already posted this question in the discussion section of an article about backtesting (https://www.mql5.com/en/forum/2309), but no one has responded so I'll post it here.

 

 Is there a way to access the functionality of metatrader's genetic optimizer in code without having to manually run the optimization from the backtesting terminal?  

 What I'm looking for is a way to optimize an EA on the fly using mql.  There has been mention of being able to do this with matlab interaction (https://www.mql5.com/en/articles/44), but I'm not familiar with matlab and therefore this would be quite difficult.  Any help/recommendations with on the fly optimization would be greatly appreciated.

The other question I have concerns backtesting tick data.  Currently I'm developing EAs and backtesting them using MT5 with a metaquotes demo account, but I'm not sure how accurate the backtesting tick data is.  After looking at some simple output of prices during backtesting, it looks like the spreads might not be accurate during backtesting.  Can anyone tell me how accurate this tick data is and if it isn't accurate, could someone tell me if it's possible to get accurate tick data?  

Thank You.

Discussion of article "Guide to Testing and Optimizing of Expert Advisors in MQL5"
  • www.mql5.com
Discussion of article "Guide to Testing and Optimizing of Expert Advisors in MQL5".
Pawel Wojnarowski
614
Pawel Wojnarowski  
johnmcgiles:

I already posted this question in the discussion section of an article about backtesting (https://www.mql5.com/en/forum/2309), but no one has responded so I'll post it here.

 

 Is there a way to access the functionality of metatrader's genetic optimizer in code without having to manually run the optimization from the backtesting terminal?  

 What I'm looking for is a way to optimize an EA on the fly using mql.  There has been mention of being able to do this with matlab interaction (https://www.mql5.com/en/articles/44), but I'm not familiar with matlab and therefore this would be quite difficult.  Any help/recommendations with on the fly optimization would be greatly appreciated.

The other question I have concerns backtesting tick data.  Currently I'm developing EAs and backtesting them using MT5 with a metaquotes demo account, but I'm not sure how accurate the backtesting tick data is.  After looking at some simple output of prices during backtesting, it looks like the spreads might not be accurate during backtesting.  Can anyone tell me how accurate this tick data is and if it isn't accurate, could someone tell me if it's possible to get accurate tick data?  

Thank You.

That's a good topic, I am also interested in such thing.
FXWinner
8
FXWinner  

Hi johnmcgiles  ,

I think you can use GO based on https://www.mql5.com/en/articles/55 and develop from it something which can dynamically be optimized in real time on charts.

Let me know how do you progress, very interesting to go beyond just MT5 backtester as charts are more attractive.

I have also concern about quality of data and gaps, found this script to export data : http://www.mataf.net/forums/History-Data-Currency-t15285.html

Let me know if you still interesting in the subject, we probably can find a way to evaluate data and create optimization on the fly.

Do you have in mind any strategy which can benefit from dynamic optimization, and how do you select stable parameters once it is optimized.

One thing comes into my mind is Cluster Walk Forward optimization, it is too advanced staff for MT5. http://www.thegrailsystem.com/forum/index.php?topic=3.0 check #33

I think it is something similar what you want to do real time, interesting to see if we can implement something equal in MT5, but it is probably any topic.

regards.

FW

Genetic Algorithms - It's Easy!
  • 2010.07.03
  • Andrey Dik
  • www.mql5.com
In this article the author talks about evolutionary calculations with the use of a personally developed genetic algorithm. He demonstrates the functioning of the algorithm, using examples, and provides practical recommendations for its usage.
newmason
12
newmason  
johnmcgiles:

I already posted this question in the discussion section of an article about backtesting (https://www.mql5.com/en/forum/2309), but no one has responded so I'll post it here.

 

 Is there a way to access the functionality of metatrader's genetic optimizer in code without having to manually run the optimization from the backtesting terminal?  

 What I'm looking for is a way to optimize an EA on the fly using mql.  There has been mention of being able to do this with matlab interaction (https://www.mql5.com/en/articles/44), but I'm not familiar with matlab and therefore this would be quite difficult.  Any help/recommendations with on the fly optimization would be greatly appreciated.

The other question I have concerns backtesting tick data.  Currently I'm developing EAs and backtesting them using MT5 with a metaquotes demo account, but I'm not sure how accurate the backtesting tick data is.  After looking at some simple output of prices during backtesting, it looks like the spreads might not be accurate during backtesting.  Can anyone tell me how accurate this tick data is and if it isn't accurate, could someone tell me if it's possible to get accurate tick data?  

Thank You.

I am interested in this subject too and i have read lots of articles for solving this problem .But I have not yet found a good way.
graziani
2179
graziani  
johnmcgiles:

 Is there a way to access the functionality of metatrader's genetic optimizer in code without having to manually run the optimization from the backtesting terminal?  

...

The other question I have concerns backtesting tick data.  Currently I'm developing EAs and backtesting them using MT5 with a metaquotes demo account, but I'm not sure how accurate the backtesting tick data is.  After looking at some simple output of prices during backtesting, it looks like the spreads might not be accurate during backtesting.  Can anyone tell me how accurate this tick data is and if it isn't accurate, could someone tell me if it's possible to get accurate tick data?   

 

I don't think so, you can only write your own in case that it is possible to start a separate thread from EA.

Regarding the data, i also have fears that data is not complete/correct, which i am about to check.
However, this seems to be the consequence of the way how market is working.
In case you don't know, every broker has its own prices which can even differ based on the server you are connected to (didn't check it on MT5, on MT4 this is so).
So that is the reason why you have separate market data and history data. These are different, i am sure.
The idea is that data in the history is some kind of compilation (i don't know how it is calculated) which is going to be same on ALL MT5 INSTALLATIONS,
so that all backtesting is same everywhere, on cloud etc.

Are you aware of the consequences? 

Also, i am pretty sure that the tick data is not in the history, but is somehow calculated/simulated.

This is i believe the reason why there are no sub-minute intervals (local server prices). 

graziani
2179
graziani  
FXWinner:


One thing comes into my mind is Cluster Walk Forward optimization, it is too advanced staff for MT5. http://www.thegrailsystem.com/forum/index.php?topic=3.0 check #33

Thanks for the link, this is a good idea/concept. You can achieve this in MT5 thanks to the OnTester() method.

To add comments, please log in or register