Close MT5 in mql5, or with option in configuration file

 

Hello,


I search how to close mt5 properly in mql5. I have a python script which launch one by one severals expert advisor.

My way in python is:

for expert in expertArrays:

        # code to prepare the configuration file
        subprocess.call([mt5ExeFilePath, confOption], timeout = 15)

Python launch mt5, mt5 launch the EA, do the job, and python force close mt5 after 15sec timeout.

But sometimes 15sec is not a good timeout. So do you know how to close mt5 just after the end of the EA ?


Thank you

Documentation on MQL5: Common Functions / ExpertRemove
Documentation on MQL5: Common Functions / ExpertRemove
  • www.mql5.com
//|                                            Test_ExpertRemove.mq5 | //|                        Copyright 2009, MetaQuotes Software Corp. | //|                                             https://www.mql5.com | //| Expert deinitialization function                                 |...
 

I have found the function terminalclose

https://www.mql5.com/en/docs/common/terminalclose

it's work very good

Documentation on MQL5: Common Functions / TerminalClose
Documentation on MQL5: Common Functions / TerminalClose
  • www.mql5.com
//| Expert deinitialization function                                 | //| Expert tick function                                             |
Reason: