[EA] [Socket] [Python] - After few hours, the SocketSend() "freeze", stop sending data... without error messages
Hi everyone,
- System:Windows / MT5
- Environnement:Python Script + Socket Server (Python) + Socket Client (MQL5)
- Problem:After few hours (around 25-26hrs) the EA stop sending any data through the socket or the Socket Server stop receiving data
I'm a fresh python coder, and for the last few days I'm trying to create an algo that can trade for me.
To do so, I created an Expert Advisor who is the socket client to send the data (Bid / Ask / and if the candle is closed or not) to my socket server in Python and then I have my python script that understand what's going on and make decision about it (e.g Long / Short...)
Even if it work like a charm for 25-26hours, it stop sending anything without error messages.
But the EA still work (still print the data in the Experts tab in MT5) and the Python script still works... The only thing that is not working is the data flow through the socket :/
In my python script I throw multiple try: Except: line, I even write everything in a log file, but nothing popped out on why the data flow stopped.
My first though was MEMORY LEAKS so I monitored my CPU / RAM but nothing shows off (screen below)
To understand better or even to reproduced it, you can find my EA code and my Python Socket below:
[EA Socket]
This EA send the Bid / Ask and detect if the candle is close or not (send 0 or 1)
[Python Socket Server]
Create the socket and receive the data...
[Screen Shot the CPU / RAM usage]
Attached below:
I have absolutely no idea on how to find why it stopped after 25hours of running...
If you have any idea, I will be so thanksfull <3
To anyone how is reading this post, I hope you are having a wonderfull day !
Mines are shit until I find a solution to my problem ^^
Cheers,
By default A broker usually disconnect a connection in 24 hours. You should code for socket client status check and reconnect on disconnection. Also must read about ping pong which keeps connection alive. I dont know which broker you are trying to connect and your server side config at
127.0.0.1
.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi everyone,
I'm a fresh python coder, and for the last few days I'm trying to create an algo that can trade for me.
To do so, I created an Expert Advisor who is the socket client to send the data (Bid / Ask / and if the candle is closed or not) to my socket server in Python and then I have my python script that understand what's going on and make decision about it (e.g Long / Short...)
Even if it work like a charm for 25-26hours, it stop sending anything without error messages.
But the EA still work (still print the data in the Experts tab in MT5) and the Python script still works... The only thing that is not working is the data flow through the socket :/
In my python script I throw multiple try: Except: line, I even write everything in a log file, but nothing popped out on why the data flow stopped.
My first though was MEMORY LEAKS so I monitored my CPU / RAM but nothing shows off (screen below)
To understand better or even to reproduced it, you can find my EA code and my Python Socket below:
[EA Socket]
This EA send the Bid / Ask and detect if the candle is close or not (send 0 or 1)
[Python Socket Server]
Create the socket and receive the data...
[Screen Shot the CPU / RAM usage]
Attached below:
I have absolutely no idea on how to find why it stopped after 25hours of running...
If you have any idea, I will be so thanksfull <3
To anyone how is reading this post, I hope you are having a wonderfull day !
Mines are shit until I find a solution to my problem ^^
Cheers,