Automating EA Optimization

 
Can someone please help me understand how to Automatically optimize my EA to a selected chart using a Python Script and the MT5 module for Python. Everything I've learned so far either 

1) Simply didn't work, 
2) Didn't make use of the MT5 Python module 
3) Required me to learn C++ and build a DLL but I'm already learning MQL5 and Python at the same time, adding a third language to the list doesn't seem feasible for me, I'd be over complicating things for myself. 

 How can I automate the entire process of Optimizing my EA and exporting the results using Python and the MT5 module only. 
 
Gamuchirai Ndawana:
Can someone please help me understand how to Automatically optimize my EA to a selected chart using a Python Script and the MT5 module for Python. Everything I've learned so far either 

1) Simply didn't work, 
2) Didn't make use of the MT5 Python module 
3) Required me to learn C++ and build a DLL but I'm already learning MQL5 and Python at the same time, adding a third language to the list doesn't seem feasible for me, I'd be over complicating things for myself. 

 How can I automate the entire process of Optimizing my EA and exporting the results using Python and the MT5 module only. 
I would use system and os modules in Python (to not use BASH), and then run optimization through command line, like in the following article:

 
zZaky Hamdoun #:
I would use system and os modules in Python (to not use BASH), and then run optimization through command line, like in the following article:

Let me try it out, thank you!
 
Zaky Hamdoun #: I would use system and os modules in Python (to not use BASH), and then run optimization through command line, like in the following article: https://www.metatrader5.com/en/terminal/help/start_advanced/start

Your answer is not applicable to Python scripts using the MT5 API. It would only be applicable for MQL EA's not Python. The Strategy Tester cannot back-test or optimise a Python "EA".

 
Gamuchirai Ndawana: Can someone please help me understand how to Automatically optimize my EA to a selected chart using a Python Script and the MT5 module for Python. Everything I've learned so far either 

1) Simply didn't work, 
2) Didn't make use of the MT5 Python module 
3) Required me to learn C++ and build a DLL but I'm already learning MQL5 and Python at the same time, adding a third language to the list doesn't seem feasible for me, I'd be over complicating things for myself. 

 How can I automate the entire process of Optimizing my EA and exporting the results using Python and the MT5 module only. 

Unfortunately there is no easy solution if you want to continue to code your "EA" in Python and the MT5 API.

The simplest of solutions is still the original one—to code your EAs in MQL and not Python.

 
Fernando Carreiro #:

Unfortunately there is no easy solution if you want to continue to code your "EA" in Python and the MT5 API.

The simplest of solutions is still the original one—to code your EAs in MQL and not Python.

 
I have no problem coding the EA in MQL,  maybe if I made my intentions clear to you you'd be able to shed more light for me:

I realized that whenever I move my EA from one chart to another its parameters need to be optimized again for that particular market.

So I figured that if I could perform just one slow optimization with the EA's default settings, I can then take the results of the slow optimization and use them to train a Machine Learning Model that will predict which settings will generate greater profits.

This is where things fell apart, running the Optimization from Code. 

I am not particular about whether I run the optimization using python or MQL5, however all statistical analysis will be done in Python using scikit learn.

Do you now see the full picture? And how could I run the optimization using MQL?

 
Gamuchirai Ndawana #: Do you now see the full picture? And how could I run the optimization using MQL?

To be honest, I don't have much faith in AI driven EAs and I have yet to see one that can outperform a conventional EA (non A.I.).

I'm a follower of the K.I.S.S. method, and prefer simple EAs, especially when they are self-adapting and require no optimisation.

To me, I consider A.I. EAs as equivalent to Rube Goldberg machines, trying to achieve the simplest of tasks.

So in essence, I have never faced your requirements.

 
Fernando Carreiro #:

To be honest, I don't have much faith in AI driven EAs and I have yet to see one that can outperform a conventional EA (non A.I.).

I'm a follower of the K.I.S.S. method, and prefer simple EAs, especially when they are self-adapting and require no optimisation.

 

So wait in conclusion is it possible to run an Optimization Test using MQL5?

And if it is, how is it done? 

 
Fernando Carreiro #:

Your answer is not applicable to Python scripts using the MT5 API. It would only be applicable for MQL EA's not Python. The Strategy Tester cannot back-test or optimise a Python "EA".

Ah! That’s unfortunate. I never used MT5’s Python integration, wasn’t aware it wouldn’t work. 
 
Fernando Carreiro #:

To be honest, I don't have much faith in AI driven EAs and I have yet to see one that can outperform a conventional EA (non A.I.).

I'm a follower of the K.I.S.S. method, and prefer simple EAs, especially when they are self-adapting and require no optimisation.

To me, I consider A.I. EAs as equivalent to Rube Goldberg machines, trying to achieve the simplest of tasks.

So in essence, I have never faced your requirements.

While it may be out of subject, I totally agree with you on the use of AI in expert advisors.

Veritasium made a good video on the feeling of being an « expert », and spoke about the finance field as well. His explanation goes pretty well with Artificial Intelligence in finance too.


At about 7-8 minutes. 
 
Zaky Hamdoun #: Veritasium made a good video on the feeling of being an « expert », and spoke about the finance field as well. His explanation goes pretty well with Artificial Intelligence in finance too.
Good example!
Reason: