Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
- www.mql5.com
Please, don't request help for ChatGPT (or other A.I.) generated code.
- Usually people who can't code don't receive free help on this forum.
- If you show your attempts and describe your problem clearly, you will most probably receive an answer from the community. Use the CODE button (Alt-S) when inserting code.
- To learn MQL programming, you can research the many available Articles on the subject, or examples in the Codebase, as well as reference the online Book and Documentation
- If you do not want to learn to code, that is not a problem. You can either look at the Codebase if something free already exists, or in the Market for paid products (also sometimes free). However, recommendations or suggestions for Market products are not allowed on the forum, so you will have to do your own research.
- Finally, you also have the option to hire a programmer in the Freelance section.
Please, don't request help for ChatGPT (or other A.I.) generated code.
- Usually people who can't code don't receive free help on this forum.
- If you show your attempts and describe your problem clearly, you will most probably receive an answer from the community. Use the CODE button (Alt-S) when inserting code.
- To learn MQL programming, you can research the many available Articles on the subject, or examples in the Codebase, as well as reference the online Book and Documentation
- If you do not want to learn to code, that is not a problem. You can either look at the Codebase if something free already exists, or in the Market for paid products (also sometimes free). However, recommendations or suggestions for Market products are not allowed on the forum, so you will have to do your own research.
- Finally, you also have the option to hire a programmer in the Freelance section.
I do not completely agree with your comments, it suggests many assumptions of a person in general. My post could be better yes but assuming many things is not a good trait.
You may as well say, people who are assumed lazy don't get help (lazy vs ability are very different). Instantly we have diverted from the goal of the post..
No assumptions were made. It is a "boiler plate" comment, with the aim of covering most situations of the sort without prejudice (search the forum and you will find it repeated many times over).
You yourself, admitted to using ChatGPT, and even stated (and I quote) ... "my understanding of coding is very limited".
So, the "boiler plate" comment is quite fitting!
No assumptions were made. It is a "boiler plate" comment, with the aim of covering most situations of the sort without prejudice (search the forum and you will find it repeated many times over).
You yourself, admitted to using ChatGPT, and even stated (and I quote) ... "my understanding of coding is very limited".
So, the "boiler plate" comment is quite fitting!
Maybe a coding quiz before being able to post on forums would be more appropriate than having to boiler plate every [redacted] post :) ?
Please delete this whole forum when you get time, its not going anywhere. I will resort to freelance instead where they accept non coders.
You are aware that this is mainly a site about MQL5 programming and not so much about how to make Windows Command line batch files, or Microsoft PowerShell scripts, right?
In all honesty the question would be more fittingly posted on a Microsoft related forum. However, your post has remained because maybe someone has tried something similar and is willing to help you out.
So, please relax, and don't get so high-strung about some boiler-plate comment that held no prejudice towards you in the least!
You are aware that this is mainly a site about MQL5 programming and not so much about how to make Windows Command line batch files, or Microsoft PowerShell scripts, right?
In all honesty the question would be more fittingly posted on a Microsoft related forum. However, your post has remained because maybe someone has tried something similar and is willing to help you out.
So, please relax, and don't so high-strung about some boiler-plate comment that held no prejudice towards you in the least!
You are right I should relax, sorry.
in the mean time, i have moved to a powershell script which uses the argument Start-Process and -Wait which waits for the terminal to close before proceeding with a new test, this should fix the issue I was having with my bat script.
Anyone should be able to use the code below to make their own version if they wish. Just make a text file, copy the code and save it as a .ps1 to be able to run it as powershell.
# Manually set .ini settings CTRL + C on MT5 Tester settings page to find exact values to input # To get .ini setup MT5 terminal, close and copy common.ini then add [Tester] as per above to the file # Paste required values into ini and confirm ExpertParameters= remains. D:\MT5Tester2\MT5 v1.15 script testing.ini # Set files to cycle through, in \MQL5\Profiles\Tester $expertParameters = @( "MT5 v1.14 bat XU BB+RSI.set", "MT5 v1.14 bat XU BB+STOCH.set", "MT5 v1.14 bat XU HL+RSI.set", "MT5 v1.14 bat XU HL+STOCH.set", "MT5 v1.14 bat XU ENV+RSI.set", "MT5 v1.14 bat XU ENV+STOCH.set", "MT5 v1.14 bat XU SMA+RSI.set", "MT5 v1.14 bat XU SMA+STOCH.set", "MT5 v1.14 bat XU BB+HL+RSI.set", "MT5 v1.14 bat XU BB+ENV+RSI.set", "MT5 v1.14 bat XU BB+SMA+RSI.set", "MT5 v1.14 bat XU DMA+RSI.set", "MT5 v1.14 bat XU DMA+STOCH.set", "MT5 v1.14 bat XU BB+HL+STOCH.set", "MT5 v1.14 bat XU BB+ENV+STOCH.set", "MT5 v1.14 bat XU BB+SMA+STOCH.set", "MT5 v1.14 bat XU HL+ENV+RSI.set", "MT5 v1.14 bat XU HL+SMA+RSI.set", "MT5 v1.14 bat XU HL+ENV+STOCH.set", "MT5 v1.14 bat XU HL+SMA+STOCH.set", "MT5 v1.14 bat XU BB+RSI+STOCH.set", "MT5 v1.14 bat XU HL+RSI+STOCH.set", "MT5 v1.14 bat XU ENV+RSI+STOCH.set" ) $pairs = @("XAUUSD") # Multi Pair example ("XAUUSD", "GBPUSD", "EURUSD") $criteria = @("6") # Multi Criteria example ("1", "2", "3", "4") $periods = @("M5") # Multi Timeframe example ("M5", "M15", "M30") $iniFile = "D:\MT5Tester2\MT5 v1.15 script testing.ini" # See https://www.metatrader5.com/en/terminal/help/start_advanced/start $logFile = "D:\MT5Tester2\script_log.txt" # Logging file $mt5Path = "D:\MT5Tester2\terminal64.exe" # Specific terminal to load, runs in /portable mode # Function to update ini file function Update-IniFile($path, $pattern, $replacement) { (Get-Content $path) -replace $pattern, $replacement | Set-Content $path } # Main loop foreach ($e in $expertParameters) { Update-IniFile $iniFile 'ExpertParameters=.*' "ExpertParameters=$e" foreach ($p in $pairs) { Update-IniFile $iniFile 'Symbol=.*' "Symbol=$p" foreach ($c in $criteria) { Update-IniFile $iniFile 'OptimizationCriterion=.*' "OptimizationCriterion=$c" foreach ($t in $periods) { Update-IniFile $iniFile 'Period=.*' "Period=$t" # Print combined information for Expert Set, Pair, and Criterion Write-Host "Pair: $p, Criterion: $c, Period: $t, Expert Set: $e" # Start MT5 terminal $startTime = Get-Date Write-Host "MT5 Start $startTime" $process = Start-Process -FilePath $mt5Path -ArgumentList "/portable /config:`"$iniFile`"" -PassThru -Wait -NoNewWindow $endTime = Get-Date Write-Host "MT5 End $endTime" if ($process.ExitCode -ne 0) { Write-Host "MT5 Terminal encountered an error. Exit Code: $($process.ExitCode)" -ForegroundColor Red } # Logging Add-Content -Path $logFile -Value "ExpertParameters: $e, Pair: $p, Criterion: $c, Period: $t, Start Time: $startTime, End Time: $endTime, Exit Code: $($process.ExitCode)" } } } } Write-Host "Script execution finished!"
- www.metatrader5.com
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
For a while I have been using this .bat script to automate testing on the MT5 strategy tester to optimise my EA.
It edits the .ini file for adjust for set file to load, the pair, timeframe and also then loops how many times to do this. Recently I have had an issue where it would do several sets like 3/4 and then the .bat script would ignore the fact mt5 is loaded and just skip .sets and keep attempting to load more and more tests which obviously just fails while MT5 is just sat there in the background working away.
I have checked all set files and saved them, no issues there but if anyone had any ideas or insight I would be most grateful. Looked into other methods of automating MT5 testing for multiple sets but so far have failed. Honestly i use chatGPT to write most of this as my understanding of coding is very limited.
Kind regards