Discussion of article "MetaTrader 5 and Python integration: receiving and sending data" - page 11
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
Thank you for this article.
Just wander why we need to keep calling socket=SocketCreate() and SocketClose() in OnTick()?
Seems a bit inefficient to repeatedly doing these.
Does it not keep the socket open/alive? Or rather is it possible keep the socket open/alive?
Hi! I was raising a socket too. I have a problem - I write an indicator in python. It takes data from mt5 a lot and as much as you want, but to return data to mt5 is not so easy. On the socket it is possible to transmit only a string up to 100 small strings, but I need more. What solutions are there besides socket? And besides web/internet requests of data exchange between Python->MT5? I don't want to raise MySQL DB for this. We are talking about transferring from python to MT5 about 40 currency pairs with a history of 1000 recalculated readings and further construction of indicator lines in MT5... I want to get away from calculations in MT5 as python does it much faster. So I would like to see all lines of the indicator and not only the last bar transmitted by a string once a second.
Using multiprocessing.shared_memory in Python and WinAPI in MQL5 allows you to read data directly from memory.Can someone advise me something useful?
TCP/IP Socket - MT5 will receive one string anyway and it will not fit 30 000 data.... Limitations of one string variable even in jason format is up to 100 strings. What is the use of such a Socket ?
It turns out that for big data one way out is Python-->MySQL-->MT5
I also came up with this idea:
other than web/internet requesters for data exchange between Python->MT5? I don't want to bring up MySQL DB.
"bring up SQLite" - MT5 has it built in, python obviously has it too...
You can use the socket to report what you need promptly (signals, alerts, etc.), and put big data into SQLite. That is, in python you put everything you need into the database and blow the whistle on the "data update" socket. And in MQL you can reread the database on the whistle.
The database itself can be stored on a frame disc
"bring up SQLite" - MT5 has it built in, python obviously has it as well.
You use the socket to report what you need promptly (signals, alerts, etc.), and put big data into SQLite. That is, in python you put everything you need into the database and blow the whistle on the "data update" socket. And in MQL you can reread the database on the whistle
The database itself can be stored on a frame disc
I see your point, thanks for the answer... I thought so
MetaTrader 5 uses its own programming language MQL5, which runs in an isolated process. This does not allow direct interaction with the shared memory of the operating system, as other applications that use low-level APIs can do.
Shell within a shell.... It's been 20 years since they can't make a native version for mac...
I see your point, thanks for the reply.... well I thought so
MetaTrader 5 uses its own programming language MQL5, which runs in an isolated process. This does not allow direct interaction with the shared memory of the operating system, as other applications that use low-level APIs can do.
Shell within a shell.... It's been 20 years since they can't make a native version for mac...
nobody forbids to use DLL - and there you can do what you want.
You can search memory directly (probably no faster :-) ).
Or efficient intermediate solutions, a la in-memory key-value db.
Only in most cases, the brakes and bottle-neck are on Python's side