29 lines
1.0 KiB
PowerShell
29 lines
1.0 KiB
PowerShell
# MT5 Batch Backtest Script
|
|
# Generated: 2026-05-29 04:13:50
|
|
|
|
$MT5Path = "C:\Program Files\MetaTrader 5 IC Markets Global\terminal64.exe"
|
|
$IniFile = "optimizer\configs\GridMaster Pro.ini"
|
|
$SetDir = "optimizer\set_files\GridMaster Pro"
|
|
$ReportDir = "optimizer\reports\GridMaster Pro"
|
|
|
|
Write-Host 'Starting batch optimization for GridMaster Pro'
|
|
|
|
$SetFiles = Get-ChildItem -Path $SetDir -Filter "params_*.set"
|
|
$Total = $SetFiles.Count
|
|
$Current = 0
|
|
|
|
foreach ($SetFile in $SetFiles) {
|
|
$Current++
|
|
Write-Host "[$Current/$Total] Processing: $($SetFile.Name)"
|
|
|
|
$IniContent = Get-Content $IniFile
|
|
$IniContent = $IniContent -replace "ExpertParameters=.*", "ExpertParameters=$($SetFile.FullName)"
|
|
$TempIni = Join-Path $env:TEMP "temp_$([guid]::NewGuid().ToString().Substring(0,8)).ini"
|
|
$IniContent | Set-Content $TempIni -Encoding UTF8
|
|
|
|
Start-Process -FilePath $MT5Path -ArgumentList "/portable","/config:$TempIni" -Wait
|
|
|
|
Start-Sleep -Seconds 3
|
|
}
|
|
|
|
Write-Host 'Batch optimization completed for GridMaster Pro!' |