Did u check firewall issue? But if it persist mt5 error 401(permission issue) then they likely blocked it. 10 requests per minute according documentation. No explanation and lots of frustration when ur fixing and testing. I guess metatrader assume error 401 = "blocked for sending too many request"? Barbaric but interesting. Anyway just speculating till somone find out. Use delay timer in code or reinstall mt5.