Files
MT5-EA-Sniper-Strategy/build.ps1
T
rithsila ec06657613 Major refactor: Streamline EA structure and fix compilation errors
- Consolidated all trading logic into single SniperEA.mq5 file
- Fixed all compilation errors (0 errors, minimal warnings)
- Removed complex modular structure that was causing issues
- Added comprehensive pattern detection (OB, BOS, FVG, Liquidity Sweeps)
- Implemented multi-timeframe analysis framework
- Added VS Code configuration for MT5 development
- Created implementation plan for completing core trading logic
- Added validation report and build scripts
- Backup original working version as SniperEA_backup.mq5

Status: 45% complete - Pattern detection working, core trading logic pending
2025-09-25 20:39:27 +07:00

61 lines
2.0 KiB
PowerShell

param(
[Parameter(Mandatory=$true)]
[string]$FilePath,
[switch]$Deploy
)
# Configuration
$MetaEditorPath = "C:\Program Files\MetaTrader 5\MetaEditor64.exe"
$MT5Directory = "C:\Users\$\AppData\Roaming\MetaQuotes\Terminal\D0E8209F77C8CF37AD8BF550E51FF075\MQL5"
Write-Host "=== MQL5 Build Script ===" -ForegroundColor Green
Write-Host "File: $FilePath" -ForegroundColor Yellow
# Check if file exists
if (-not (Test-Path $FilePath)) {
Write-Host "✗ Error: File not found: $FilePath" -ForegroundColor Red
exit 1
}
# Check if MetaEditor exists
if (-not (Test-Path $MetaEditorPath)) {
Write-Host "✗ Error: MetaEditor not found at: $MetaEditorPath" -ForegroundColor Red
exit 1
}
Write-Host "✓ Starting compilation..." -ForegroundColor Green
# Compile the file
$process = Start-Process -FilePath $MetaEditorPath -ArgumentList "/compile", "`"$FilePath`"" -Wait -PassThru -WindowStyle Hidden
if ($process.ExitCode -eq 0) {
Write-Host "✓ Compilation successful!" -ForegroundColor Green
# Check if .ex5 file was created
$ex5File = $FilePath -replace '\.mq5$', '.ex5'
if (Test-Path $ex5File) {
Write-Host "✓ Generated: $ex5File" -ForegroundColor Green
if ($Deploy) {
# Deploy to MT5 directory
$fileName = Split-Path $ex5File -Leaf
$targetPath = Join-Path $MT5Directory "Experts\$fileName"
try {
Copy-Item $ex5File $targetPath -Force
Write-Host "✓ Deployed to: $targetPath" -ForegroundColor Green
}
catch {
Write-Host "⚠ Warning: Could not deploy to MT5 directory: $_" -ForegroundColor Yellow
}
}
} else {
Write-Host "⚠ Warning: .ex5 file not found after compilation" -ForegroundColor Yellow
}
} else {
Write-Host "✗ Compilation failed with exit code: $($process.ExitCode)" -ForegroundColor Red
exit 1
}
Write-Host "=== Build Complete ===" -ForegroundColor Green