dwx-zeromq-connector icon indicating copy to clipboard operation
dwx-zeromq-connector copied to clipboard

Array out of range in DWX_ZeroMQ_Server_v2.0.1_RC8.mq4

Open Saruntaey opened this issue 4 years ago • 6 comments

I have been modified DWX_ZeroMQ_Server_v2.0.1_RC8.mq4 to be able to perform my strategy. My workflow as per below.

  1. The EA keep track on market. when something interesting occor it will execute python script.
  2. Python script connect to the same ports as setup in EA. then request the opened orders detail.
  3. Python script perform some task. then request the opened orders detail again to modify orders.
  4. After the order was modified the python script is terminated.
  5. The EA keep tracking the market again.

The problem is the EA may get request from somewhere ( default ports was used ). I don't know how. So these break the code as per attatched picture below.

err_msg code

I am sure that this request didn't come from python script because EA status inform that it didn't execute the python script.

My question is :

  1. How this occur? and how to handle?
  2. When the EA get error as attatched picture, is it keep working or terminated?

Saruntaey avatar Oct 20 '19 09:10 Saruntaey

Hi @Saruntaey ,

Sounds like you either have more than one instance of a client application running on your system, connecting to the same EA, or some other process also attempting to connect to the same ports sending instructions.

Please provide both the modified Python and MQL source code files as attachments, it isn't possible to assist with this query based on images unfortunately.

Thanks!

integracore2 avatar Nov 06 '19 10:11 integracore2

@integracore2 Thank you for your responds. Pleases find my code as per attatched files. The upload only included MT4 connect module. How can I check if other process connect to the same ports as assigned. Is there are any method to find the free ports to use for communication between MQL and Python? If not how to handle this?

python.zip DWX_ZeroMQ_Server_v2.0.1_RC8_Modified_V5.zip

My code set up is per below.

  1. I have 2 MT4 accounts runing on seprate terminal.
  2. Attatch DWX_ZeroMQ_Server_v2.0.1_RC8_Modified_V5.mq4 to each MT4 therminal. The only different set up is ports number.

Thank you.

Saruntaey avatar Nov 06 '19 12:11 Saruntaey

I'm having the same problem, I don't know why this could happened. So weird.

donggiggedin avatar Oct 31 '20 08:10 donggiggedin

Does anyone found a solution to this problem?

brenoperucchi avatar Dec 01 '20 16:12 brenoperucchi

I faced a similar problem. This halts expert advisor until mt4 is manually restarted.

This issue is reproducible when a null message is received on ZeroMQ Socket.

Adding this check just before line 311 should fix this:

   if (ArraySize(compArray) == 0) {
      return;
   }

Its not exactly clear to me which program is sending such message as i don't see anything related to null sending within Python code, my guess would be this could be due to a botnet scan on the default open port 32768. Also, noticed that default Hostname is binded to *, As there is no authentication, setting HOSTNAME = 127.0.0.1 in parameters should be more secure (by not being open to internet) imo to avoid similar issue.

vsp4 avatar Jan 17 '21 09:01 vsp4

@vsp4 Thanks, I will try.

brenoperucchi avatar Jan 17 '21 12:01 brenoperucchi