#!/bin/bash # Syntax checker for MQL5 files before compilation FILE="$1" if [ -z "$FILE" ]; then echo "Usage: $0 " exit 1 fi echo "=== Checking $FILE for obvious MT4→MT5 conversion issues ===" echo "" echo "MT4 functions that won't work in MT5:" grep -n "OrderSend(\|OrderClose(\|OrderSelect(\|MarketInfo(\|WindowExpertName(\|IsOptimization(" "$FILE" | head -10 echo "" echo "Global variables that should be functions in MT5:" grep -n "\bBid\b\|\bAsk\b\|\bDigits\b\|\bPoint\b" "$FILE" | grep -v "SymbolInfoDouble\|SymbolInfoInteger" | head -10 echo "" echo "Ticket types (should be ulong, not int):" grep -n "int.*ticket\|int.*Ticket" "$FILE" | head -5 echo "" echo "WinAPI includes (will fail in Wine/MT5):" grep -n "WinAPI\|winuser\|WinUser" "$FILE" echo "" echo "=== Quick Fix Check ===" ERRORS=$(grep -c "OrderSelect(\|MarketInfo(\|WindowExpertName(\|IsOptimization(" "$FILE" 2>/dev/null) if [ "$ERRORS" -gt 0 ]; then echo "⚠️ WARNING: Found $ERRORS MT4-only functions!" echo "This file will NOT compile in MT5. It needs conversion." else echo "✅ No obvious MT4 functions found" fi