darwinex / dwx-zeromq-connector

Wrapper library for algorithmic trading in Python 3, providing DMA/STP access to Darwinex liquidity via a ZeroMQ-enabled MetaTrader Bridge EA.
https://blog.darwinex.com/zeromq-interface-python-r-metatrader4/
BSD 3-Clause "New" or "Revised" License
341 stars 227 forks source link

Problem with Publish_Instruments #131

Closed aioannou96 closed 2 years ago

aioannou96 commented 3 years ago

I am trying to run it but I am getting the following error:

'Publish_Instruments' - cannot be initialized with initializer list

I have tried the following: Instrument Publish_Instruments[1] = {"EURUSD_M1"} ; Instrument Publish_Instruments[1] = {("EURUSD", PERIOD_M1)} ;

Please help!!

Thank you, Alex

elvinex commented 2 years ago

Hi, I am not sure about the exact error, but in the current version you don't have to set Publish_Instruments yourself. You don't have to modify the mql4 code at all if you are only using the provided functions. If you subscribe to a symbol from python, it should be added automatically to Publish_Instruments. The confusion maybe came from an older tutorial.

Btw. we published the DWX Connect package which is probably better suited for most of the use cases.