My God, MT4 chart froze again! How to prevent the disaster happen on live trading?

 

Please refer to the screenshot attached that 1 of the open charts froze at 9 hours ago and other open charts are still alive.

It’s the screenshot of my live account with the latest version of MT4 terminal. The correct server time should be 13:51 as shown as the bottom right local time.

To be honest, it’s not the first time observing the chart freezing as it happened with different brokers during my EA “Spread Tracking” testing.

I can’t imagine how to deal if it happens on charts with live EA trading. Why does it happen? How to prevent it?

 

 

 
jollydragon: I can’t imagine how to deal if it happens on charts with live EA trading. Why does it happen? How to prevent it?
The right side shows 28 bars from 1 Oct 11:00 so the current bar is 2 Oct 14:00 which is close enough to current to conclude that the chart is not frozen.

Your EA is. Fix your broken EA.

 
WHRoeder:
The right side shows 28 bars from 1 Oct 11:00 so the current bar is 2 Oct 14:00 which is close enough to current to conclude that the chart is not frozen.

Your EA is. Fix your broken EA.


 

Dear WHRoeder, 

It happened with different broker accounts for several times and thought it's terminal or broker issue.

Now you remind me it's my code issue. But I haven't any idea how it comes from my code. Do you have any idea on possible reasons or mistakes in my EA? 

 
If there isn't a divide by zero in the log, then you have an infinite loop; add print statements at the start and exit of your function.
 
WHRoeder:
If there isn't a divide by zero in the log, then you have an infinite loop; add print statements at the start and exit of your function.

 

Today I tested my code with half-year history tick data without any issue found. May I conclude no issue in my code?

Every time when I tested in broker account, I usually test for 1 day and found the issues for several times. 

 
jollydragon:

 

Today I tested my code with half-year history tick data without any issue found. May I conclude no issue in my code?

Every time when I tested in broker account, I usually test for 1 day and found the issues for several times. 

The EA is probably badly written, the apparent effectiveness on historical data proves nothing except that you have a limited understanding of the issue.


For example, during periods of high tick activity it is probably choking on its own code. ie has not finished finalising a calculation before the next tick arrives, This will produce live data gaps, which would not be apparent on Historical Data, 

 
jollydragon: May I conclude no issue in my code?
A car with one lost cylinder runs, but it is still broken.
 
As I remember, it didn't happen only with this EA. I double checked my code and couldn't find any issue. Please let me test forward and try to reproduce the issue again.
Reason: