Download MetaTrader 5

Automating MT5 Strategy Tester

To add comments, please log in or register
Christian74
17
Christian74  

I am interested in automating the new Strategy Tester for MT5.

Why? Rather than manually running the Strategy Tester against my EA's with different input parameters, capturing the output reports and comparing them... I hope to do so programmatically. An MQL5 script would be perfect.

Is this possible? Can anyone point me in the right direction please?


cheers,

Christian

Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Running MQL5 Program Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Environment State / Running MQL5 Program Properties - Documentation on MQL5
Roger Flatt
22
Roger Flatt  
Christian74:

I am interested in automating the new Strategy Tester for MT5.

Why? Rather than manually running the Strategy Tester against my EA's with different input parameters, capturing the output reports and comparing them... I hope to do so programmatically. An MQL5 script would be perfect.

Is this possible? Can anyone point me in the right direction please?


cheers,

Christian

Hi, Christian

I think I have a similar problem. I have an EA which is working OK, but it has several combined Indicators, each with a variable set of parameters. I want to backtest several different weightings, for example, a tolerance level from 0.025% to 1.500% in 0.025% intervals. Lots of manual work - too much.

I am thinking of using the File functions in MQL5, and putting my EA in a top level loop, each writing separate calculations (and Indicator status) to separate TSV files that I can interrogate via Excel.

From there, I can home in the most important indicators for my market (FOREX), and change them dynamically intra-day as things hot up or cool down.

 

Very best of luck,

Todge. 

 

jakesullivan
7
jakesullivan  

And also you can use some helpful features in Meta trader. For example I’m using a forex robot, witch is making some stable not big money, but because of it I can spend my time on learning FOREX without fears about the loss. Here is a video how to install robot into Meta Trader (http://clicks.aweber.com/y/ct/?l=NDy8Z&m=I_GkiJXSxTWeOp&b=FjM5DtBrLOn1KWduGTZB0g), I think it will be very useful for a newbie. Have a good day!

jcarrion
13
jcarrion  

Well , we are doing something barely similar.  MQL5 being "almost" C++ you can simply develop your indicators' funcion ( for the whole period - generated by courtesy of  MQL5  )  and then running the whole thing on native code (C++)

 

We're doing this as we optimize the stuff in an array of CUDA processors. . Got sort off multithreadable -CUDA native-   code , that simply reads , executes , and  gets the results... running a CUDA compiled version of the EA.

 

Indeed the EA we are working on , can't really run -even on the fastest(s)i7 - on real time. As we obviously would like to get the forecasts before they happen , we are running the whole shit on native C++, *in CUDA paralell processors* and using MQL5 just for reading a generated file  (per tick)  containing the current forecasts.

 

(pity the Championship doesnt allow running 80x86/CUDA native code )

 

 

Max Payne
411
Max Payne  

Interesting CUDA extension! Do you use a tool to translate MQL5 into native C++/CUDA or was this done manually?

Cheers!
Pawel Wojnarowski
686
Pawel Wojnarowski  

If automation of mouse/keyboard/events meets some of your needs, try AutoIt. It's freeware, with a great feedback from the community and plenty of examples to find in the forum, provides quite a wide range of possibilities. And it's as simple as it gets (I'm writing AutoIt scripts in Windows notepad). It also allows user to create .exe from a script. I use it at work to automate the parts of testing that can't be covered in my testing environment's default software.

Here is the list of functions implemented in AutoIt (see if you could make use of any of it):

http://www.autoitscript.com/autoit3/docs/functions.htm 

And here is the official AutoIt website:

http://www.autoitscript.com/autoit3/index.shtml

Brett Luedtke
114
Brett Luedtke  

An alternative software to Enigma's software is http://www.autohotkey.com/ which is open source freeware. I used this software to automate a lot of my paperwork after my shift at my factory job. :)

AutoHotKey has a nice little extension for recording mouse and keyboard actions to help you get a nice base for your macro. Add some if qualifiers, a main loop and turn the "hard" automations (like click events) into a "Soft" event, like pressing at X coordinates in A program.

I don't have time to tell you how that would work for you right now but if you are interested I would be happy to put something together for you when time permits. 

AutoHotkey
  • www.autohotkey.com
AutoHotkey is a free, open-source utility for Windows. With it, you can: Automate almost anything by sending keystrokes and mouse clicks. You can write a mouse or keyboard macro by hand or use the macro recorder. Create hotkeys for keyboard, joystick, and mouse. Virtually any key, button, or combination can become a hotkey. Expand...
Pawel Wojnarowski
686
Pawel Wojnarowski  
If it is only recording mouse and keyboard events, I'd rather be careful with such software. It means that it could go wild if you change the sizes of the windows, position of the buttons etc. AutoIt is even able to use single component handles, like window handle or a button handle so it is not dependent on the screen resolution, window position, button position etc.
Max Payne
411
Max Payne  
Enigma71fx:

If automation of mouse/keyboard/events meets some of your needs, ...


I don't think that the OP was looking for a solution that has to go through the GUI of the tester, but rather a way to write your own test driver directly in MQL5.

Cheers!

Brett Luedtke
114
Brett Luedtke  
Enigma71fx:
If it is only recording mouse and keyboard events, I'd rather be careful with such software. It means that it could go wild if you change the sizes of the windows, position of the buttons etc. AutoIt is even able to use single component handles, like window handle or a button handle so it is not dependent on the screen resolution, window position, button position etc.

Right, even though English is my native language I couldn't find the words for explaining that... :)

Both software then have that feature, good thing. The reason I mentioned the recording tool is it is perfect for a quick fix, or to get a quick code for what needs to be done, then switch out the raw data with more flexible programmatic ways. 

Maka4Tune
26
Maka4Tune  
Max Payne:

I don't think that the OP was looking for a solution that has to go through the GUI of the tester, but rather a way to write your own test driver directly in MQL5.

Cheers!

The original question here hasn't been answered. I too would like to run several test iterations (potentially hundreds) on an indicator across multiple currency pairs and time periods to see how it functions in different environments.

Has anyone done this yet? 

12
To add comments, please log in or register