Screenshot ofDirectory and Errors here
I'm trying to built an algorithmic trading bot. First step is to establish a connection between Python and MQL4 EA. I have the dir set up correctly. As shown below and my scripts are as follows. My Python script is listening for a reponse although i am never able to compile the script in MQL4 - it gives the following errors.Screenshot attached. Any advice would be greatly appreciated.
Notes - using fusion markets version of MT4
Python
import zmq
print("Current libzmq version is ", zmq.zmq_version())
print("Current pyzmq version is ", zmq.pyzmq_version())
context = zmq.Context()
# Create a REP socket instead of PAIR
socket = context.socket(zmq.REP)
socket.bind("tcp://*:5555")
# Wait for a request
message = socket.recv_string()
print("Received request: %s" % message)
# Send a reply
socket.send_string("Hello from Python!")`
MQL4
// Include the ZMQ library
#include <Zmq/Zmq.mqh>
// Create a ZMQ context
ZmqContext context;
// Create a ZMQ socket
ZmqSocket socket(context, ZMQ_REQ); // ZMQ_REQ means it's a Request socket
// The entry point of the script
int start() {
// Connect to a ZMQ server
socket.connect("tcp://localhost:5555"); // replace "localhost:5555" with your ZMQ server address
// Send a message
socket.send("Hello from MQL4!");
// Receive a message
char buffer[256];
socket.recv(buffer);
// Print the received message
Print("Received: ", buffer);
return 0;
}
I tried changing the code, ensuring python script was running. Redownloading zmq files and moving to dir etc.