Script will not close terminal

To add comments, please log in or register
rob
106
rob  
ShutdownTerminal=true
Server=ETXCapital-Demo Server
Login=7001248
Password=xxx
EnableNews=false
Script=batchGenSymbolsData
Period=M5
Symbol=SP500_SB
Report=ReportSP500_SBM5
ReplaceReport=true

I have tried:

ShutdownTerminal=1

ShutdownTerminal=true

ShutdownTerminal=True

I cannot get the script to close programmatically. Everything is working other than this issue?

MetaTrader: version 4.00 build 1090, 19th May 2019

I cannot find anything to help me in here:

https://www.metatrader4.com/en/trading-platform/help/service/start_conf_file

Configuration at Startup - Tools - MetaTrader 4 Help
Configuration at Startup - Tools - MetaTrader 4 Help
  • www.metatrader4.com
The client terminal can be launched with some predefined settings. For this purpose, the configuration file name will be passed to the client terminal as a parameter. If the full path to the file (Drive:\SubDirectory\FileName) is not given, the file will be searched for in the client terminal's data folder. The configuration file contains...
whroeder1
17943
whroeder1  
robI cannot get the script to close programmatically.

If is a script, return from OnStart. Closing the terminal is a different problem (make up your mind,) and not possible in Mt4 IFRC

rob
106
rob  
whroeder1:

If is a script, return from OnStart. Closing the terminal is a different problem (make up your mind,) and not possible in Mt4 IFRC

Yes sorry. It is the terminal that I cannot get to close when run through the .ini file as described above. Is there a script example anywhere that I might copy? I have had this build terminating an EA from a .ini file last year but for some reason am unable to replicate it now.

'and not possible in Mt4 IFRC' ??

rob
106
rob  

Might help someone operating under linux - wrote a bash script to do the job - long way round but works now

Needs the dummy.txt file created at the end of the MQL4 script:

   //used to close terminal in batch run
   int handle=FileOpen("dummy.txt",FILE_WRITE|FILE_CSV);
   FileClose(handle);
#!/bin/bash
cd /home/rob/.wine/drive_c/Program\ Files\ '('x86')'/MetaTrader\ 4/MQL4/Files/
#make sure no dummyfile exists
[ -e dummy.txt ] && rm -- dummy.txt
#load terminal .ini test file
cd /home/rob/.wine/drive_c/Program\ Files\ '('x86')'/MetaTrader\ 4/
wine start terminal.exe test.ini
#go to directory for metatrader files written
cd /home/rob/.wine/drive_c/Program\ Files\ '('x86')'/MetaTrader\ 4/MQL4/Files/
#echo 'variable symbol: '$1
#echo 'variable timeFrame: '$2
#filename='cumulative_profit_'$1'_'$2'.csv'
filename='dummy.txt'
#echo $filename
until [ -f $filename ]
do
    echo 'No terminating file dummy.txt'
    #dont hog the cpu
    sleep 5
done
echo 'closed dummy file'
terminalProcess='terminal.exe'
echo "killing terminal ... "$terminalProcess
pkill -9 terminal.exe
echo "killed terminal: "$terminalProcess
exit

Used a python script to loop around passing  test.ini files to above bash for further analysis

To add comments, please log in or register