Script that automatically runs backtesting/optimization? #310
-
I have experience with automating things using Python. For example I've written automators for both The GUI itself is automatable using pywinauto_recorder and python scripting skills in general. So I was wondering wouldn't it be nice to run optimization steps say for a week-to-a-month long on a loop? It then automatically would choose the best strategy for you, but if that doesn't work very well we could always put the probablistic change-of-strategy information into an HMM or at least a probability matrix. You can then run this loop once on all of history and have the correct strategy statistics for working with in the present. Or that is one application of this automatic strategy tester script - to gather statistics of strategies that will probably work. They made no way to programmatically control the strategy tester so some hacking is needed or simply GUI automation. Later we can replace the easily-made GUI automation code with a hack / patch of the MetaTrader executable (but that is more difficult in my oppinion, so we should first see if this automation leads to good EA's, statistically before doing that). |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Actually, there is a way of controlling the Strategy Tester through a setup file: |
Beta Was this translation helpful? Give feedback.
-
You don't need any GUI automation hacks, MetaPlatform support headless configs, but it's not well documented. Also in that link that you posted. Check Backtesting using Docker page (could be a bit outdated).
Currently problem is if you optimize in MT4, some strategies may not work as well as in MT5, and other way round. At some point we'll need to compare candle by candle why it's different and fix it.
It's already done using GitHub Actions for MetaTrader 4, see: See:
Notes:
However I don't currently set best results back to EA files, because:
The process can be improved further more once it's more reliable. If you check the existing scripts and have further ideas, let me know.
Picking EA's strategy best is only a small portion of it, as each strategy has their own set of settings to optimize as well (period, filters, and so on) which are hidden by default (but can be enabled by |
Beta Was this translation helpful? Give feedback.
Yo…