I am using windows 10, I have 2 laptops and i tried on both and got the same error
Thembekile Thembekile:
I am using windows 10, I have 2 laptops and i tried on both and got the same error
did you run the socket function in strategy tester? i think it's not possible from strategy tester
I am using windows 10, I have 2 laptops and i tried on both and got the same error
According to SocketConnect() documentation,
Connection address should be added to the list of allowed ones on the client terminal side (Tools \ Options \ Expert Advisors).
So, in MetaTrader Tools\Options\Expert Advisors, add 127.0.0.1 to the Allow WebRequest for listed URL.
![Documentation on MQL5: Network Functions / SocketConnect Documentation on MQL5: Network Functions / SocketConnect](https://c.mql5.com/36/41/documentation-on-mql5-network-functions.png)
Documentation on MQL5: Network Functions / SocketConnect
- www.mql5.com
//| SocketExample.mq5 | //| Copyright 2018, MetaQuotes Software Corp. | //| https://www.mql5.com | "Add Address to the list of allowed ones in the terminal settings to let the example work...
The function can be called only from Expert Advisors and scripts, as they run in their own execution threads. If calling from an indicator, GetLastError() returns the error 4014 – "Function is not allowed for call".
You need only add socket server address into "Allow WebRequest for listed URL" (Tool-> Option -> Expert Advisors)
![Documentation on MQL5: Checkup / GetLastError Documentation on MQL5: Checkup / GetLastError](https://c.mql5.com/36/50/documentation-on-mql5-checkup-getla.png)
Documentation on MQL5: Checkup / GetLastError
- www.mql5.com
GetLastError - Checkup - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
changes the "localhost" to 127.0.0.1 ( or your IP SERVER, pls don't use localhost as address)
Why not use "localhost"?
Please elaborate your statement.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
I'm new to working with network function, I'm trying to create a simple client server connection between a python app and MQL5 following this tutorial https://www.mql5.com/en/articles/5691. I read the docs of networks functions again and i saw that you get this error if you call the network function from anything other than a script or EA. But this does not make since because i'm using an ea, here is a sample, code fails at: with 4014 error