lucas-campagna / mt5linux

MetaTrader5 for linux users
MIT License
82 stars 46 forks source link

copy_ticks_range not work #13

Closed Lisaccount closed 1 year ago

Lisaccount commented 1 year ago

mt5.copy_rates_from_pos works fine but mt5.copy_ticks_range not work

mt5.copy_ticks_range(symbol, utc_from, utc_to, flags) Traceback (most recent call last): File "/home/u20/anaconda3/lib/python3.9/site-packages/IPython/core/interactiveshell.py", line 3369, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-10-38d55dc15869>", line 1, in <cell line: 1> mt5.copy_ticks_range(symbol, utc_from, utc_to, flags) File "/home/u20/anaconda3/lib/python3.9/site-packages/mt5linux/__init__.py", line 2580, in copy_ticks_range return rpyc.utils.classic.obtain(self.__conn.eval(code)) File "/home/u20/anaconda3/lib/python3.9/site-packages/rpyc/core/netref.py", line 240, in __call__ return syncreq(_self, consts.HANDLE_CALL, args, kwargs) File "/home/u20/anaconda3/lib/python3.9/site-packages/rpyc/core/netref.py", line 63, in syncreq return conn.sync_request(handler, proxy, *args) File "/home/u20/anaconda3/lib/python3.9/site-packages/rpyc/core/protocol.py", line 473, in sync_request return self.async_request(handler, *args, timeout=timeout).value File "/home/u20/anaconda3/lib/python3.9/site-packages/rpyc/core/async_.py", line 102, in value raise self._obj _get_exception_class.<locals>.Derived: name 'datetime' is not defined ========= Remote Traceback (1) ========= Traceback (most recent call last): File "C:\users\u20\AppData\Local\Programs\Python\Python39\lib\site-packages\rpyc\core\protocol.py", line 356, in _dispatch_request res = self._HANDLERS[handler](self, *args) File "C:\users\u20\AppData\Local\Programs\Python\Python39\lib\site-packages\rpyc\core\protocol.py", line 837, in _handle_call return obj(*args, **dict(kwargs)) File "C:\users\u20\AppData\Local\Programs\Python\Python39\lib\site-packages\rpyc\core\service.py", line 156, in eval return eval(text, self.namespace) File "<string>", line 1, in <module> NameError: name 'datetime' is not defined

lucas-campagna commented 1 year ago

Hi, @Lisaccount!

This seems to be the same problem as this one https://github.com/lucas-campagna/mt5linux/issues/3.