**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 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.