IsConnected() problem...

 

For the past week or so I  have had the EA problem of trades being opened but intermittently not being closed, destroying 2 demo-accounts in the process.  My buggy-code - or so I thought - turns out what is happening is that after a random period of time, Broco's servers are signalling that their server connection is down (via use of the IsConnected() command) even though the 'Connection Status' icon indicates everything is OK.  Worse,  even though IsConnected() was returning false, I wasn't including this check when placing trades, but was when closing them, meaning that orders were being opened but were not being closed ('cos IsConnected()  was false...)  Add to that, if you then select a different demo-server, the disconnect-reconnect action seems to 'fix' IsConnected(), at least for a while...


The same EA has been behaving OK for almost 3 years so either Broco is messing, there is a bug in IsConnected() or there is something wrong with my Broco install...


EDIT:  Conveniently it has just 'misbehaved' again - the value after "Conn:" from the 'Close Conditions Status' line is what IsConnected() is returning, which is 0 or false, resulting in orders which should have closed profitably, being left open... 

 
Hmmm, seems to have been Broco playing games - for the past 24hrs everything has mysteriously started working properly again!  While most MT brokers level of service seems to be improving (slightly), Broco is a definite exception - their antics around newstime is getting hard to stomach and definitely seems part of their overall business-plan - cut the feed at the slightest hint of volatility.......
 

This is getting silly - now Broco appears to be f%cking about with the IsTradeAllowed() MT function (see pic. - the 'ITA:' value).  Having forward-tested stuff with WHC/Broco for years now, I can honestly state that I have never seen these problems before, of course I never felt the need to directly monitor IsConnected() and IsTradeAllowed() until now either!!!

Just think how many apparent 'bugs' (and blown accounts) brokers can introduce just by playing games like this - 'quietly' disable trading when they believe an EA will close trades in profit!  Not as obvious as just cutting the connection, and all the time the coder thinking that his code is the issue.....


 

Although I have had three different demo platforms running for some time now, only Broco is playing with both IsConnected() and IsTradeAllowed().  But what I have only just realised is that although EA's are prevented from opening/closing trades by this manipulation, manual trading is still possible!

Though, obviously nobody else seems to have found this kind of 'skullduggery' to be an issue...

 

Is this just with 223, or worse with 223?

-BB-

 

There is no difference that I can tell - it was happening with 221/222 as well.  I also have the same EA running with TheCollective & PCIFX - With TheCollective it runs perfectly, whereas PCIFX for some idiotic reason keep disabling my demo-accounts (which is completely unrelated to the IsConnected() thingy)  Like I mentioned, this never occurred with Broco in the past three years until a few weeks ago, who seemed content till then with their max. 100 order, 20 lots impediments, and of course their cutting the data-feed on newstime volatility, to bias things in their favour.  And these guys constantly advertise themselves as the top-rated broker with lowest spreads - incredible!!!  (and of course, both untrue)

One other thing I've noticed, then confirmed in the MQL documentation, the GetLastError() variable doesn't record errors caused by any of these commands, (IsConnected(), IsTradeAllowed, IsTradeContextBusy() etc.) making it even harder to debug account-destroying 'bugs' like this.....