MetaTrader 5 Python User Group - how to use Python in Metatrader - page 13

 
Dmitriy Skub:

Maybe I'm setting the path to the terminal wrong?

MT5Initialize(r'D:\Programs\ОТКРЫТИЕ-Брокер')

Try it like this.

 
Sergey Dzyublik:

Try this.

Same: No IPC connection

 
Dmitriy Skub:

Same: No IPC connection

Why do you specify the path to the folder?
Try it this way:

MT5Initialize(r'D:\Programs\ОТКРЫТИЕ-Брокер\terminal64.exe')
 
Dmitriy Skub:

Same thing: No IPC connection

I have a dongle/portable on my laptop - could not call MT5 from Python, then I ran MT5 and ran the Python script again - everything was connected

Vince10 installed

 
Sergey Dzyublik:

Why do you specify the path to the folder?
Try it this way:

If you leave MT5Initialize() without a line, it connects another terminal. It connects normally and gets data from it.

I tried it this way - it doesn't work.

terminal64.exe
 
Igor Makanu:

I have a key/portable on my laptop - could not call MT5 from Python, then ran MT5 and ran the Python script again - all connected

Vince10 installed

I already have MT5 running - I can't connect to it with the path I've set.
 
Dmitriy Skub:
I already have MT5 running - can't connect to it with the path I set.

Checked, everything works correctly in MT5 (build 2025) with Python API Connector to MetaTrader 5 Terminal (5.0.3):

 MT5Initialize(r"D:\Programs\ОТКРЫТИЕ-Брокер\terminal64.exe")
 
Sergey Dzyublik:

I checked it, it works correctly in MT5 (build 2025) with Python API Connector to MetaTrader 5 Terminal (5.0.3):

Yes, it worked. Thank you, Sergey!

I forgot the letter r before the line).

Build 2007 is ok.


Inaccuracy in documentation - it should be full file name, not file path:

[in] Path to the file metatrader.exe or metatrader64.exe. If the path is not specified, the module will try to find the executable by itself.
 
Maxim Dmitrievsky:

At the moment any info (other than quotes) can be sent/returned via real-time sockets. The only limitation is that it does not work in the tester yet.

Any info (other than quotes) can be sent/returned via real-time sockets - including Sell/Buy orders?
 
slukin:
Any information (other than quotes) can be sent/returned via real-time sockets - including Sell/Buy orders?

of course, but you can also use pips in the tester

Reason: