A lot of changes have been made over the past year, old scripts are no longer working.
There is a terminal MT5 build 2361, 32bit on Windows 7. The terminal itself works, but connection of python scripts has stopped working (although it was working at the beginning of the year).
Obviously due to terminal updates, nothing else has changed. For the test run a simple script
import MetaTrader5 as mt5
from time import sleep
mt5.initialize()
print('start')
print(mt5.terminal_info())
sleep(10)
mt5.shutdown()
print('end')
Question what version of MetaTrader5 python module should I install to make it work again ? (Or how to rollback the terminal updates ?)
I tried different versions of module - all of them have errors. Those that are newer give out -10003, 'IPC initialize failed, MetaTrader 5 x64 not found',
some of them initialize and run terminal, but they return RuntimeError: IPC recv failed in 'py_test.py'.
The oldest 5.0.10 has other commands, but they don't work either.
Terminal can't update to newer versions, there was some working version of python module, but I can't find it now.
64-bit version of the terminal requires OS updates and a lot of other updates, plus 64-bit OS eats many times more memory and disk space, bad choice. In general, the policy of auto-updating anything is bad. If it works, do not touch it.
In general, you should have a table in the documentation which versions are compatible with which, if you do not support compatibility with older versions and updates are forced.
В платформу встроена система автоматического обновления. Она позволяет своевременно получать и устанавливать новые версии программы. Эту систему отключить нельзя. Порядок обновления При подключении к торговому серверу происходит проверка наличия обновлений платформы. Если найдено обновление какого-либо из компонентов торговой платформы...
Support for the 32-bit operating system was disabled many builds ago. The terminal has changed a lot since then. Hence the likely solution to your problem: you MUST use 64-bit Windows 10.
But there WAS a compatible build of the terminal and module, you can just install them, without any new features.
And requiring Windows 10 64 bit is too much for a program like the terminal. It is too heavy, greedy, unreliable to run anything that requires long-term operation. There are also problems with automatic updates. It's a pity that MT is tied to this system.
As long as there is no demand and no prepared audience.
4 people have expressed demand so far, in the machine learning topic :) it seems to me that if there is an opportunity and a couple of articles on the topic, pythonists will start to port models. Especially English-speaking ones.
I can't print the first five lines of the DataFrame object.
I take the script from the 'data folder'\Scripts\Python\copy_rates_from.py' and add the lines:
from datetime import datetime
import MetaTrader5 as mt5
# выведем данные о пакете MetaTrader5
print("MetaTrader5 package author: ",mt5.__author__)
print("MetaTrader5 package version: ",mt5.__version__)
# импортируем модуль pandas для вывода полученных данных в табличной форме
import pandas as pd
pd.set_option('display.max_columns', 500) # сколько столбцов показываем
pd.set_option('display.width', 1500) # макс. ширина таблицы для показа
# импортируем модуль pytz для работы с таймзоной
import pytz
# установим подключение к терминалу MetaTrader 5if not mt5.initialize():
print("initialize() failed")
mt5.shutdown()
# установим таймзону в UTC
timezone = pytz.timezone("Etc/UTC")
# создадим объект datetime в таймзоне UTC, чтобы не применялось смещение локальной таймзоны
utc_from = datetime(2020, 1, 10, tzinfo=timezone)
# получим 10 баров с EURUSD H4 начиная с 01.10.2020 в таймзоне UTC
rates = mt5.copy_rates_from("EURUSD", mt5.TIMEFRAME_H4, utc_from, 10)
# завершим подключение к терминалу MetaTrader 5
mt5.shutdown()
# выведем каждый элемент полученных данных на новой строке
print("Выведем полученные данные как есть")
for rate in rates:
print(rate)
# создадим из полученных данных DataFrame
rates_frame = pd.DataFrame(rates)
# выведем пять первых строк (метод 'head' pandas)
print("\nВыведем пять первых строк")
rates_frame.head()
rates_frame['time']=pd.to_datetime(rates_frame['time'], unit='s')
# выведем данные
print("\nВыведем датафрейм с данными")
print(rates_frame)
rates_frame['time']=pd.to_datetime(rates_frame['time'], unit='s')
# выведем данные
print("\nВыведем датафрейм с данными")
print(rates_frame)
and the method doesn't output anything:
(1578614400, 1.11051, 1.11093, 1.11017, 1.11041, 2448, 1, 0)
Выведем пять первых строк
Выведем датафрейм с данными
Why the 'head()' method didn't work, but this maneuver:
# выведем пять первых строк (метод 'head' pandas)
print("\nВыведем пять первых строк")
print( rates_frame.head())
Result
Выведем пять первых строк
time open high low close tick_volume spread real_volume
015784848001.113841.113861.111101.112001210100115784992001.112001.113081.110871.111801324300215785136001.111801.111801.110181.11041570900315785280001.110531.111941.110331.11174440900415785424001.111741.111901.111261.11183296400
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Renat, is there any update on ONNX support?
No.
There is no demand and no prepared audience yet.
A lot of changes have been made over the past year, old scripts are no longer working.
There is a terminal MT5 build 2361, 32bit on Windows 7. The terminal itself works, but connection of python scripts has stopped working (although it was working at the beginning of the year).
Obviously due to terminal updates, nothing else has changed. For the test run a simple script
import MetaTrader5 as mt5 from time import sleep mt5.initialize() print('start') print(mt5.terminal_info()) sleep(10) mt5.shutdown() print('end')Question what version of MetaTrader5 python module should I install to make it work again ? (Or how to rollback the terminal updates ?)
I tried different versions of module - all of them have errors. Those that are newer give out -10003, 'IPC initialize failed, MetaTrader 5 x64 not found',
some of them initialize and run terminal, but they return RuntimeError: IPC recv failed in 'py_test.py'.
The oldest 5.0.10 has other commands, but they don't work either.
Terminal can't update to newer versions, there was some working version of python module, but I can't find it now.
64-bit version of the terminal requires OS updates and a lot of other updates, plus 64-bit OS eats many times more memory and disk space, bad choice. In general, the policy of auto-updating anything is bad. If it works, do not touch it.
In general, you should have a table in the documentation which versions are compatible with which, if you do not support compatibility with older versions and updates are forced.
Support for the 32-bit operating system was disabled many builds ago. The terminal has changed a lot since then. Hence the likely solution to your problem: you MUST use 64-bit Windows 10.
But there WAS a compatible build of the terminal and module, you can just install them, without any new features.
And requiring Windows 10 64 bit is too much for a program like the terminal. It is too heavy, greedy, unreliable to run anything that requires long-term operation. There are also problems with automatic updates. It's a pity that MT is tied to this system.
You NEED to use 64-bit Windows 10.
What's wrong with Windows 7 x64? Did I miss another update???
What's wrong with Windows 7 x64? Did I miss another news???
Seems to me 7 is better than 10. no orientation on mobile systems.
For me 7 is better than 10. no orientation to mobile systems.
I agree, worked on 10 for almost a year and was happy with 7 when I came home!
No.
As long as there is no demand and no prepared audience.
I run it both as a script in MetaEditor and in jupyter notebook.
I can't print the first five lines of the DataFrame object.
I take the script from the 'data folder'\Scripts\Python\copy_rates_from.py' and add the lines:
and the method doesn't output anything:
Why the 'head()' method didn't work, but this maneuver:
Forum on trading, automated trading systems and strategy testing
New version of MetaTrader 5 build 2650: Background Loading of Charts and Improvements in MQL5 Profiler
Rashid Umarov, 2020.11.10 14:03
Try it
Result
worked?
Why didn't the 'head()' method work, but this manoeuvre:
worked?
Because the head() method(https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.head.html) returns an object, not output to the log. To see the content, you need to explicitly send the object to print()
This anaconda for convenience outputs the objects as if print() had been called.