MQL5 | Unable to create socket even though I allowed "127.0.0.1" for web requests | Attempting to connect to a Python program.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello everyone! Here is the context:
I was trying to develop a MQL5 Expert Advisor capable of sending JSON documents to a Python program, but I stumbled across a problem that I couldn't solve not even asking to ChatGPT or Deepseek, as well as I tried to reproduce solutions that I found in the forum, spoiler alert, nothing worked. So I'm using the forum as a last resource, let me show you what the situation is on my computer (maybe this code works just fine in your PC and that would be infuriating for me, just let me know):
1. First of all let's start by showing my terminal settings... (see image attached to this post, I took a screenshot)
2. Here is my MQL5 object which I use to create a socket, when creating an instance I pass host and port to it:
3. Here is a bit of code inside my OnInit() function where I want to execute SocketHandler methods create and connect:
4. Here is the output when executing this code, even if it is an Expert Advisor, I still get a 4014 error which according to the documentation it is thrown only when calling SocketCreate function from an indicator, this is not the case because I made this EA by using the Mql5 wizard, I also placed my MQL5 program under the Experts -> My Expert Advisors folder in my terminal, as well as I have OnInit, OnTick and OnDeInit functions on my program:
2025.03.06 17:44:05.729 2010.01.01 00:00:00 bool SocketHandler::create() 29 Error al crear el socket. Código: 4014
Whatever information you need I'll be at your disposal!