The run_bot.bat console path froze for minutes after two log lines with 0 CPU:
asyncio.run() -> ProactorEventLoop.__init__ -> socket.socketpair() -> Python
3.12 _fallback_socketpair() blocks forever in accept() on the loopback TCP
handshake (security software filters 127.0.0.1 in this interactive console +
xau-trader.exe session). Git-bash redirect runs worked 4/4, proving it is
environment, not interpreter.
Windows 10 17063+ supports AF_UNIX sockets, which need no loopback TCP at all.
Monkey-patch socket.socketpair on win32 to self-pair over AF_UNIX via ctypes
(ws2_32; python.org builds don't expose the AF_UNIX constant), falling back to
the stock socketpair if AF_UNIX is unavailable. socket.socket(fileno=N) treats
N as a raw SOCKET handle on Windows, so the raw handles wrap cleanly.
Verified: smoke test raw pair family=1 + full asyncio.run Proactor loop; the
exe boot went from hang to 'Main loop started' in ~10s.
Co-Authored-By: Claude Code <noreply@anthropic.com>
- Implemented scripts/train_ai.py for institutional XGBoost training on MT5 historical candles
- Integrated 46 multi-indicator features, TimeSeriesSplit validation, and feature importance drivers
- Added --train-only and improved --train in main.py
- Enabled MT5 AutoTrading configuration ([Experts] AllowLiveTrading=1)
- Added send_pending_order and cancel_order to MT5Connector (BUY_LIMIT, SELL_LIMIT, BUY_STOP, SELL_STOP)
- Added automatic 12-hour periodic model retraining job in BotScheduler and TradingBot
- Updated Telegram Command Center with MT5 standalone fallback and pending order telemetry
- Placed live test BUY market trade and scheduled BUY_LIMIT order on XAUUSD