MetaTrader 5 Python User Group - how to use Python in Metatrader - page 51
![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
A new build of the python library 5.0.25 has been released
Please update via:
Gentlemen, can we ask to add objects like:
add pls or __dict__, or as_dict()
In python it is much more convenient to operate with standard structures, the same dict/list.
It would be nice to pull dict from this class (and other similar ones) and work with it.
Question about initialize(), there are
respectively in path paths to two terminals which run /portable
but allinitialize calls go to the last running instance of the terminal.
respectively MT build 2360 and MetaTrader5-5.0.26-cp38-cp38-win32.whl
What's wrong? path should be used with some other logic, or should something else be passed to /portable?
Show the actual code, please.
We don't accept parameters in the paths yet.
Show the actual code, please.
We don't accept parameters in the paths yet.
Here is the code:
Last running terminal:
"c:\Works\MT5 - terminals\ForexClub MT5\terminal64.exe"
Judging by the screenshot, the call went to the last running one.
I'd like to call the specific ones that were accessed.
We don't accept the parameters in the tracks yet.
Mmm ... I don't quite understand this point, the value but not the parameter, this is where I take the connection parameters out of the config.
Question about initialize(), there are
respectively in path paths to two terminals which run /portable
but allinitialize calls go to the last running instance of the terminal.
respectively MT build 2360 and MetaTrader5-5.0.26-cp38-cp38-win32.whl
What's wrong? path should be used with some other logic, or should something else be passed to /portable?
Do you want 2 terminals in one script to work simultaneously? It's not possible, next initialize call will break connection with the first terminal, for that you need to enter connection entity to distinguish different terminals. It only works with one current connection.
initialize has one more parameter (not yet documented)mt5.initialize(blabla, portable=True) tostart terminal hard in portable mode.
Do you want to operate 2 terminals simultaneously in one script? This is not possible, the next initialize call will break the connection to the first terminal, so you need to enter a connection entity to distinguish between the different terminals. It only works with one current connection.
initialize has one more parameter (not yet documented)mt5.initialize(blabla, portable=True) to start terminal in portable mode.
Yes, you should work with multiple terminals running inportable mode. You can't initialize connection with two different terminals at the same time. No questions here.
I tried it to address terminals one by one:
in this scheme, it doesn't work. In all cases it crashes to the last terminal manually started in the system. Even if it was started from
mt5.initialize(blabla, portable=True)- didn't help much, it still prompts the last terminal started in the system.There's a question here.
Forum on trading, automated trading systems and strategy testing
MetaTrader 5 Python User Group - Summary
nikoli shen, 2020.03.07 15:46
There is a problem with downloading the MetaTrader 5 package using the pip version that comes with python. A workaround is to update the pip. Command to update pip in Windows:or in venv, using
Do you want to operate 2 terminals simultaneously in one script? This is not possible, the next initialize call will break the connection to the first terminal, you need to enter a connection entity to distinguish between the different terminals. It only works with one current connection.
initialize has one more parameter (not yet documented)mt5.initialize(blabla, portable=True) to start terminal hard in portable mode.
Note that mt5.terminal_info() shows
valuepath='C:\\\Works\\\\\MT5 - terminals\\MetaTrader 5', data_path='C:\Works\\\\MT5 - terminals\\\MetaTrader 5',commondata_path='C:\Users\\\rip\AppData\\\Roaming\\MetaQuotes\\Terminal\\\Common'
are identical. Is it supposed to be like this?
The code is below:
Do you want to operate 2 terminals simultaneously in one script? This is not possible, the next initialize call will break the connection to the first terminal, you need to enter a connection entity to distinguish between different terminals. It only works with one current connection.
Is creating an entity (connection) possible in principle? I don't think it's that necessary, but for future reference.
When installing another script (Py) on the chart, the first one is reset. Is this the way it should be?