You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to use the mt5 copy_rates_range function, I get the following error log:
Traceback (most recent call last):
File "/opt/.pycharm_helpers/pydev/_pydevd_bundle/pydevd_exec2.py", line 3, in Exec
exec(exp, global_vars, local_vars)
File "<input>", line 1, in <module>
File "/usr/local/lib/python3.8/site-packages/mt5linux/__init__.py", line 2290, in copy_rates_range
return rpyc.utils.classic.obtain(self.__conn.eval(code))
File "/usr/local/lib/python3.8/site-packages/rpyc/core/netref.py", line 240, in __call__
return syncreq(_self, consts.HANDLE_CALL, args, kwargs)
File "/usr/local/lib/python3.8/site-packages/rpyc/core/netref.py", line 63, in syncreq
return conn.sync_request(handler, proxy, *args)
File "/usr/local/lib/python3.8/site-packages/rpyc/core/protocol.py", line 473, in sync_request
return self.async_request(handler, *args, timeout=timeout).value
File "/usr/local/lib/python3.8/site-packages/rpyc/core/async_.py", line 102, in value
raise self._obj
File "<string>", line 1
mt5.copy_rates_range("WINV24", 2, datetime.datetime(2024, 9, 2, 0, 0, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=75600), '-03')), 2024-09-03 00:00:00)
^
_get_exception_class.<locals>.Derived: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers
@thmmcoelho:
I had the exact same problem. By chance, I saw that the author has implemented a fix for this in the mt5linux -> init.py.
Copy the file again into your IDE from the host, and then the retrieval with date_to will work.
I added 2 lines, and it worked. Hope this helps
When I try to use the mt5 copy_rates_range function, I get the following error log:
This is my code:
I tried to add mt5.execute('import pytz') and mt5.execute('import datetime'), as mentioned in #3, but this does not work.
The text was updated successfully, but these errors were encountered: