testsid:
Hi
I am building a custom EA for MT5
When it is attached to a chart, the Socket Connection is made in OnInit() function & the connection is closed in OnDeinit() function while detaching the EA.
My code is:
I want that the new socket connection should get created if I update the timeframe of the chart while the EA is still attached to it.
However, if I update the timeframe of the chart while the EA is still attached to it, then it displays "Error in connecting to localhost:9090 Error : 5272" in the journal.
I am clueless about how to re-connect to the socket
Kindly help
Regards
if (reason!=REASON_CHARTCHANGE)
I replaced
void OnDeinit(const int reason) { //--- SocketClose(socket); ObjectsDeleteAll(ChartID(),-1,-1); }
by
void OnDeinit(const int reason) { //--- if (reason!=REASON_CHARTCHANGE) SocketClose(socket); ObjectsDeleteAll(ChartID(),-1,-1); }
However, the issue is still the same
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi
I am building a custom EA for MT5
When it is attached to a chart, the Socket Connection is made in OnInit() function & the connection is closed in OnDeinit() function while detaching the EA.
My code is:
I want that the new socket connection should get created if I update the timeframe of the chart while the EA is still attached to it.
However, if I update the timeframe of the chart while the EA is still attached to it, then it displays "Error in connecting to localhost:9090 Error : 5272" in the journal.
I am clueless about how to re-connect to the socket
Kindly help
Regards