darwinex / dwxconnect

Seamlessly link any Trading Strategy in ANY programming language to Darwinex liquidity via MetaTrader 4 or 5. DWX Connect is your very own, fully customizable Trading API!
BSD 3-Clause "New" or "Revised" License
166 stars 88 forks source link

Functions returns empty dict #24

Closed ujyr81 closed 1 year ago

ujyr81 commented 2 years ago

Is it normal to get empty dict while invoking get_historic_data() method? I can read txt file inside mt4 dirs and access desired data, but I'm still getting some errors:

`Exception in thread Thread-5: Traceback (most recent call last): File "C:\Python38\lib\threading.py", line 932, in _bootstrap_inner Exception in thread Thread-1: Traceback (most recent call last): File "C:\Python38\lib\threading.py", line 932, in _bootstrap_inner self.run() File "C:\Python38\lib\threading.py", line 870, in run self.run() File "C:\Python38\lib\threading.py", line 870, in run self._target(*self._args, *self._kwargs) File "D:\Code\Trading\Darwinex\dwx_client.py", line 320, in check_historic_data self._target(self._args, **self._kwargs) File "D:\Code\Trading\Darwinex\dwx_client.py", line 222, in check_messages self.event_handler.on_historic_data( AttributeError: 'DWX' object has no attribute 'on_historic_data' self.event_handler.on_message(message)

AttributeError: 'DWX' object has no attribute 'on_message'`

elvinex commented 1 year ago

Hi, Did you use the default file dwx_client_example.py?

The functions on_historic_data and on_message have to be defined for the event handler (in this case class tick_processor) that is passed through self.dwx = dwx_client(self, ...).