Discussion of article "MetaTrader 5 and Python integration: receiving and sending data" - page 6
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
Hi all
Note
Connection address should be added to the list of allowed ones on the client terminal side (Tools \ Options \ Expert Advisors).
If connection fails, error 5272 (ERR_NETSOCKET_CANNOT_CONNECT) is written to_LastError.
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".
https://www.mql5.com/en/docs/network/socketconnect
Hi Maxim Dmitrievsky,
I allowed the localhost and it's working correctly.Thank you very much! But when I ran in backtest using the Strategy Tester, the error 4014 persisted. The socket doesn't work with backtest?
Best regardsHi Maxim Dmitrievsky,
I allowed the localhost and it's working correctly.Thank you very much! But when I ran in backtest using the Strategy Tester, the error 4014 persisted. The socket doesn't work with backtest?
Best regardsYes, all right. Metaquotes disabled this feature in backtester, but they say maybe allow this in near future.
Why not close "xxx" immediately after receiving a response from the server, instead of continuing to wait for the response until it reaches TimeOut?
I'm referring to the amazing programme developed by @MaximDmitrievsky -> https://www.mql5.com/en/articles/5691
(( The socketreceive() function listens on a port, and returns it as a string when there is a response from the server: ))
Congratulations on this great article.
Good morning, I'm getting a dll error
Traceback (most recent call last):
ImportError: DLL load failed: The specified module could not be found.
Does anyone know what I'm doing wrong?
<Deleted>
This is an English language forum. Please only post in English.
Hi,
Could someone write an example code how to open a 'Buy' or 'Sell' position from Python and also how to close that postition?
Or maybe is that not possible?
Many thanks!
Good morning, I'm getting a dll error
Traceback (most recent call last):
ImportError: DLL load failed: The specified module could not be found.
Does anyone know what I'm doing wrong?
Hello Antonio,
this error usually happens when you try to install the library on a Python that isn't Python for Windows. Try installing https://www.python.org/downloads/ and see if it corrects the error.
Cheers
MetaTrader5 module does not work
import MetaTrader5 as mt5 works like this
but when from MetaTrader5 import * (I connect it completely it goes out in Pycharme).
Can anyone tell me what the problem is?????
how to connect a metatrader5 indicator to python.
Thanks