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
344 stars 228 forks source link

Remote connecting to ec2 instance from local pc #37

Closed alhennessey92 closed 5 years ago

alhennessey92 commented 5 years ago

Hi, i have a windows ec2 instance on AWS that is running an MT4 platform with the Darwinex Zeromq EA 24/7. I am trying to connect to it from my local computer. I have followed your instructions listed in your readme and if i try to run the python client from my computer (notably changing the _host variable in the DWX_ZeroMQ_Connector_v2_0_1_RC8.py file of the client to the ec2 IPv4 elastic public ip) it gives me the following error.

[INIT] Ready to send commands to METATRADER (PUSH): 32768 [INIT] Listening for responses from METATRADER (PULL): 32769 [INIT] Listening for market data from METATRADER (SUB): 32770 [EURUSD_Trader] Alright, here we go.. Gerrrronimooooooooooo! ..... xD

+--------------+

  • LIVE UPDATES + +--------------+

Resource timeout.. please try again. Failed to send commands

[EURUSD_Trader] {'_action': 'OPEN', '_type': 1, '_symbol': 'EURUSD', '_price': 0.0, '_SL': 100, '_TP': 100, '_comment': 'EURUSD_Trader', '_lots': 0.01, '_magic': 123456, '_ticket': 0} -> MetaTrader None

However, if i run the same client on the ec2 instance itself, changing the same variable _host to 127.0.0.1, then it works fine and creates trades etc... I am guessing that there is an issue with the connection to the ec2 instance. I have checked all the security groups for the instance that allow connections on all ports and IP's inbound and outbound. I am wondering if i need to change any other variables in the client or on the MT4 EA to allow remote connections not from a local computer.

Thanks for the help