Socket/Websocket communication 4014 error

 
0

I am trying to create a communication interface between a python socket server and a Metatrader 5 Expert Advisor.

I've tried multiple approaches and tutorial's I found online for both sockets and websockets. All of these approaches yield the same problem.

Whenever I start a debug on live/historical data, I get a Socket creation error with code 4014. According to the error codes it is a "Function is not allowed for call" error.

Multiple sources recommended to allow web request from specified URL's. Ive done this as well for 127.0.0.1 and localhost. (Tools > options > Expert Advisors)

Why am I getting a function not allowed for call error, and how can this be fixed?

Expert code:

int socket=SocketCreate();
  
  
int OnInit()
  {
     if(SocketConnect(socket,"127.0.0.1",9090,1000)) 
       {
        Print("Connected to "," 127.0.0.1",":",9090);
       }  
     else
       {
        Print(GetLastError());
       }

   return(INIT_SUCCEEDED);
  }

void OnDeinit(const int reason)
  {
   SocketClose(socket);  
  }

void OnTick()
{
  SocketClose(socket); 

}
Timeline for Metatrader 5 Python Socket/Websocket communication 4014 error
Timeline for Metatrader 5 Python Socket/Websocket communication 4014 error
  • stackoverflow.com
Stack Overflow | The World’s Largest Online Community for Developers
 
add "localhost" in "Allow WebRequest for listed URL" list