Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array out of range in DWX_ZeroMQ_Server_v2.0.1_RC8.mq4 #49

Open
Saruntaey opened this issue Oct 20, 2019 · 6 comments
Open

Array out of range in DWX_ZeroMQ_Server_v2.0.1_RC8.mq4 #49

Saruntaey opened this issue Oct 20, 2019 · 6 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@Saruntaey
Copy link

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?
@integracore2
Copy link
Collaborator

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 integracore2 self-assigned this Nov 6, 2019
@integracore2 integracore2 added the help wanted Extra attention is needed label Nov 6, 2019
@Saruntaey
Copy link
Author

@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.

@donggiggedin
Copy link

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

@brenoperucchi
Copy link

Does anyone found a solution to this problem?

@vsp4
Copy link

vsp4 commented Jan 17, 2021

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.

@brenoperucchi
Copy link

@vsp4 Thanks, I will try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants