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

 

MetaTrader5 module is written with use of compiled library. (C, C++, ...)

The Python Package Index (PyPI) has a compiled library loaded for Python 3.7 (whl) only.

Any other version of Python will require compiling this library, Visual Studio, maybe something else.

In general, you will need Python 3.7 for trouble-free installation and operation.

Or ask the developers to build Whells for multiple versions of Python.

Glossary — Python Packaging User Guide
  • packaging.python.org
Binary Distribution Built Distribution A format containing files and metadata that only need to be moved to the correct location on the target system, to be installed. is such a format, whereas distutil’s is not, in that it requires a build step before it can be installed. This format does not imply that Python files have to be precompiled...
 
Lyuk :

MetaTrader5 module is written using compiled library.(C, C++, ...)

The Python Package Index (PyPI) has a compiled library loaded for Python 3.7 (whl) only.

Any other version of Python will require compiling this library, Visual Studio, maybe something else.

In general, Python 3.7 is required for problem-free installation and operation.

Or ask the developers to build Whells for multiple versions of Python.

Then why there is no compiled library for Python 3.5.0? I've seen and read the documentation for MetaTrader5 on PyPI.

Check it out:


 

Apparently they don't think it's worth the hassle, or they are busy doing something else. They just started this integration with python. I wrote above, too, that the actual behavior does not coincide with the documentation. Maybe they will do it with time, if there is demand.

As for the actual behavior, see here https://pypi.org/project/MetaTrader5/#files, not the description.

 
jaffer wilson:

Then why is there no compiled library for Python 3.5.0? I've seen and read the documentation for MetaTrader5 on PyPI.

Check it out:


I'm not a programmer, just wanted to try the connection. Installed Anaconda,MT5installs with no error, data is coming in, even managed to get a chart from this article.

https://www.mql5.com/ru/articles/5691

Соединение MetaTrader 5 и Python: получение и отправка данных
Соединение MetaTrader 5 и Python: получение и отправка данных
  • www.mql5.com
Сетевой сокет является конечной точкой межпроцессного взаимодействия через компьютерную сеть. В стандартной библиотеке MQL5 есть группа функций Socket, которые обеспечивают низкоуровневый интерфейс для работы в сети интернет. Этот интерфейс является общим для разных языков программирования, так как он использует системные вызовы на уровне...
 
Глава 18. Построение сервера с нуля - Полное руководство параллельного программирования на Python
  • onreader.mdl.ru
В этой главе мы проанализируем более развитое приложение программирования совместной обработки; построение с нуля некоего работающего неблокируемого сервера. Мы охватим сложные применения имеющегося модуля , такие как изоляция бизнес логики конкретного пользователя от обратных вызовов и написание конкретной логики обратного вызова внутри...
 
Boris Dyck:

I am not a programmer, just wanted to try the connection. Installed Anaconda,MT5installs without error, data is coming in, even managed to get the chart from this article.

https://www.mql5.com/ru/articles/5691

 
How can I download the Python API usage history , similar to a strategy tester download?
The Fundamentals of Testing in MetaTrader 5
The Fundamentals of Testing in MetaTrader 5
  • www.mql5.com
The idea of ​​automated trading is appealing by the fact that the trading robot can work non-stop for 24 hours a day, seven days a week. The robot does not get tired, doubtful or scared, it's is totally free from any psychological problems. It is sufficient enough to clearly formalize the trading rules and implement them in the algorithms, and...
 

Has anyone already used Python integration in MetaEditor in builds 2302 and above (better beta 2304)?


The first version of integration into the editor is working now, and the next will be:

  • running scripts (not experts) and services as Python *.py programs
  • a completely rewritten metatrader5 python library with access to charts, symbols, ability to trade, trading history
  • highlight in editor

Already running *.py and *.ipynb programs in the editor works.

Please give it a try.


After the machine learning via python scripts is complete, we will move on to implementing WinML with ONNX natively in MQL5 itself.

 
jaffer wilson:

Then why is there no compiled library for Python 3.5.0? I have seen and read the documentation for MetaTrader5 on PyPI.

In version 5.0.11 they included versions 3.6, 3.7 and 3.8.

Unfortunately, we will not support older versions. Soon we will rewrite the whole library from scratch and add many functions, including trading.

 
Renat Fatkhullin:

Soon we will rewrite the whole library from scratch and add many functions, including trading.

What motivates you to do this?


I am writing the Tester's automatizer for the second day. I'm going to post it in the KB, and I'd like to somehow understand if it's a necessary thing or just another geeky hack. Because I often don't understand why developers don't do it but actively do something else, which seems to be in less demand. I may be wrong in my assessment.