MetaTrader 5 Python User Group - how to use Python in Metatrader - page 31
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
Compiling for python scripts in the editor means running them for execution inside the editor.
Look at the output in the error windows and the log. The log shows the main output, and the error windows show the stderr output.
Compiling for python scripts in the editor means running them for execution inside the editor.
Look at the output in the error windows and the log. The log shows the main output and the error window shows stderr output.
I see. There are no errors in the Error window,
but in the log window, the script is probably waiting for my action.
As I understand it, there is just no feedback (probably not yet).
Then I try to run the example from post #1 (https://www.mql5.com/ru/forum/306688 )- installed the matplotlib package and MetaTrader5.
Trying to run example from first post
In errors
In log
and nothing happens (terminal is running at the same time).
Compiling for python scripts in the editor means running them for execution inside the editor.
Look at the output in the error windows and the log. The log shows the main output, and the error windows show the stderr output.
So the .py script will not compile to .ex5 ?
And run it from the navigator.
I see. There are no errors in the "Errors" window,
but in the "Log" window, the script is probably waiting for my action.
As I understand it, there's just no feedback (probably not yet).
Then I try to run the example from post #1 (https://www.mql5.com/ru/forum/306688 )- installed the matplotlib package and MetaTrader5.
Trying to run example from first post
In errors
In log
and nothing happens (terminal is running).
MetaTrader5 library is not installed, do it:
everything works:
So, the .py script will not be compiled to .ex5 ?
And run it from the navigator.
Of course, it won't compile, but will be visible in the navigator as a *.py program and run hidden in a separate terminal thread.
Communication with the terminal via the MetaTrader 5 Python library.
Not supplied with MetaTrader5 library, do it:
everything works:
The library is installed:
(was put in immediately withmatplotlib)
Added: and does not run in python:
Of course, it won't be compiled, but will be visible in navigator as *.py program and run hidden in a separate thread of the terminal.
Communication with the terminal via the built-in MetaTrader 5 library for Python.
Now I get it, it will be like a Python visual notebook, only the whole code is run.
I've been working my butt off about the compilation, and the compilation would have been awesome.
The thing is, with standard .py to .exe compilation, there is very little protection against reverse-engineering. You could say it's useless.
If .py compiled to .ex5, it would really boost mql5 in terms of wow mql5 compiles to an executable well protected by .ex5.
Python has this as a global problem, think about it. Especially since python compiles to .exe, uses C or C++ like compiler.
And mql5 uses LLVM.
Uninstalled python. Installed 3.8.1 x64.
When running in Python now has these errors:
The library stands:
(was supplied immediately along withmatplotlib)
Added: and does not run in python:
You have Python 3.8, put better 3.7.6 as many libraries are not yet ready for 3.8 anyway
1) From the command line, check the script.
2) Check that python path is in PATH.
3) Make sure there is only one copy of Python, and no conflicts with other versions.
4) Make sure the path to the single copy of Python in the editor is correct.
It's quite possible that you have a zoo of indirectly installed Pythons from different environments like Visual Studio.
Then I try to run the example from post #1 (https://www.mql5.com/ru/forum/306688 )- installed the matplotlib package and MetaTrader5.
Trying to run the example from the first post
In errors
In log
and nothing happens (terminal is running at the same time).
We need to wait a bit - the script requests data from 28.01.2019 - it takes time.
Second possible reason - limited value of " Max bars in window" is specified in the terminal.
The help explicitly states https://www.mql5.com/ru/docs/integration/python_metatrader5/mt5copyratesfrom_py
If this is really about the number of bars, you can either change the limit or fix the script to take the nearest minutes, e.g. for 2020 - this should work