MT5 - Terminal.exe exit code for automation

To add comments, please log in or register
Anthony Garot
3625
Anthony Garot  

Question:

Does terminal.exe return an exit code other than 0?

Description:

I'm using python to automate optimizations. An optimization will fail, for example, when none of the parameters are selected for optimization. The journal gives this message:

2018.01.24 10:58:52.653 Tester  no optimized parameter selected, please check input(s) to be optimized and set start, step and stop values

And it appears that terminal.exe returns a 0.

If the optimization runs, terminal.exe likewise returns a 0.

I searched for documentation on terminal.exe command line parameters, but the only reference that I have found is here, and it does not describe terminal.exe exit codes:

https://www.metatrader5.com/en/terminal/help/start_advanced/start#command_line

Is this the expected behavior?

Oh, my python code in case I made some sort of mistake . . . .

import subprocess
import os

TERMINAL = "C:\\Program Files\\MetaTrader 5\\terminal64.exe"
TESTER_INI = os.getcwd() + "\\tester.ini"
CONFIG_LINE = '/config:' + TESTER_INI
#print(TERMINAL + " " + CONFIG_LINE)

retcode = subprocess.call([TERMINAL, CONFIG_LINE])
print(retcode)
Alain Verleyen
39047
Alain Verleyen  

Never heard about a way to fix a return code. Probably something to confirm with the Service Desk.

Anthony Garot
3625
Anthony Garot  
Alain Verleyen:

Never heard about a way to fix a return code. Probably something to confirm with the Service Desk.

Roger that. Thanks @Alain
jlstvzm5
34
jlstvzm5  
I will choose another way to get the parameters.
To add comments, please log in or register