If is a script, return from OnStart. Closing the terminal is a different problem (make up your mind,) and not possible in Mt4 IFRC
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' ??
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
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I have tried:
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