MetaTrader 5 Platform Update Build 6090: General Improvements - page 4

 
Alain Verleyen #:

You are lying. You have been asked to collaborate to understand and reproduce the issue (and so it would be possible to fix it if a bug is really found), and you refused. Simple as that.

There is no such general behaviour as what you describe with MT5 on all EAs/Indicators. It's specific, and so it needs to be investigated from the code used when it happens. There is no other way. No company in the world would invest time on something the way you report it, being unpleasant and rude additionally.

I got a hint from P4L yesterday.
He posted a link to his earlier thread on FF:
https://www.forexfactory.com/thread/1210964-mt4-slow-test-if-your-onchartevent-is-compatible
This lead me to check the OnChartEvent() function in my AVWAP.
I removed the parts associated with CHARTEVENT_OBJECT_DELETE and the unnecessary if() statement which was at the top, inside OnChartEvent().
Maybe it's too early to judge definitely, but the symptom didn't occur after that.
BTW, the parts I removed were added by AI, and I had ignored them before.
I wasn't aware that this may cause such side effects.
However, I was aware that the OnChartEvent() function does provide a backdoor, so...
Running this further today:

//+------------------------------------------------------------------+
//| OnChartEvent                                                     |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {
   if(id==CHARTEVENT_OBJECT_DRAG)
     {
      if(sparam==VLineName)
        {
        TimeStart = (datetime)ObjectGetInteger(ChartID(), VLineName, OBJPROP_TIME);
         g_ancAnchorTime = TimeStart;
         iStart = iBarShift(_Symbol, _Period, TimeStart, false);
         ObjectSetInteger(ChartID(),VLineName,OBJPROP_BACK,true);
         ObjectSetInteger(ChartID(),VLineName,OBJPROP_SELECTED,true);
         ObjectSetInteger(ChartID(),VLineName,OBJPROP_SELECTABLE,true);
         ObjectSetString(ChartID(),VLineName,OBJPROP_TOOLTIP,ToolTipText+"_"+TimeToString(TimeStart,TIME_DATE|TIME_MINUTES));

         RecalculateAnchoredVWAP(iStart);
         ChartRedraw(0);
        }
     }
   else if(id==CHARTEVENT_OBJECT_CLICK)
     {
      if(sparam==ButtonName)
        {
         PlaySound("tick.wav");
         ResetLineToIdle();
        }
     }
  }

//+------------------------------------------------------------------+
MT4 slow? Test if your OnChartEvent is compatible with others
MT4 slow? Test if your OnChartEvent is compatible with others
  • www.forexfactory.com
Share ideas, debate tactics, and swap war stories with forex traders from around the world.
 
rkdius #:
The lag is not caused by indicators. It's caused by EA. I have the same issue, I've been reporting that the execution of indicators is broken and chart response is broken, and only answer I get is they will do nothing about it. The EA is supposed to be running in separate thread but for some reason it's choking indicators. You can test it, when it starts lagging close the EA and everything will come back to order. I don't even bother to report these things anymore. They will do nothing about it.
No, it's not caused by my EA.
I don't know about yours, but my EA is OK.
BTW. When it starts choking, you can do anything, click anything, remove anything, change TFs, and it will come back to order.
So, how did you exactly figure out that it was the EA???
 
Dadas #:
So, how did you exactly figure out that it was the EA???

I right-clicked on the top-right corner EA icon and then Remove, which removes EA from the chart and everything came back to order.

I'm sure your EA is OK, no issues. The issue is MT5 executing indicators and EAs, especially with the OnChartEvent function, like you just mentioned. This is not an issue with your indicators and your EA. The issue is how MT5 runs these indicators and EAs and how it handles chart functions and events.

There is nothing you can do to "fix" or optimize your indicators and EA, you can strip them off line by line and it won't help. You can add Error checking and it will only produce chart response errors or "indocator is too slow", all bogus errors while the issue is somewhere inside the MT5. Because of that, there is nothing useful in logs and journal.

However do not get discouraged to report these issues. More people report those more chances they will eventually do something about it, or at least they will not blow it off as non-existent issue so easily. 

 
rkdius #:

I right-clicked on the top-right corner EA icon and then Remove, which removes EA from the chart and everything came back to order.

I'm sure your EA is OK, no issues. The issue is MT5 executing indicators and EAs, especially with the OnChartEvent function, like you just mentioned. This is not an issue with your indicators and your EA. The issue is how MT5 runs these indicators and EAs and how it handles chart functions and events.

There is nothing you can do to "fix" or optimize your indicators and EA, you can strip them off line by line and it won't help. You can add Error checking and it will only produce chart response errors or "indocator is too slow", all bogus errors while the issue is somewhere inside the MT5. Because of that, there is nothing useful in logs and journal.

However do not get discouraged to report these issues. More people report those more chances they will eventually do something about it, or at least they will not blow it off as non-existent issue so easily. 

But that doesn't prove that the EA was the culprit.
Or that the symptom had anything to do with the EA running.
Why?
Because the same effect (everything comes back to order) happens when we switch TFs, or click Auto Trade, or reapply our template, etc.
So, we can never eliminate anything and come to the conclusion that the EA is causing this.
I really did spend at least 2 weeks, every day, and with AI, trying to figure out what actually is causing this.
That's why I finally came here seeking further help.
And yes, I do agree that it looks like the most likely reason is some bug in the way MT5 operates.
And I also agree that such a seemingly random bug is almost impossible to trace without being able to reproduce it.
So, I am cooperating.
I sent my source codes to Alain Verleyen in the hope that this will potentially help.
 

You're right, the EA itself is not a problem, the way it is run by MT5 is the problem.

All I'm saying is that you won't get "indicator too slow" error without the EA running along with indicators. But even without any EA running there are issues with chart response, there is a lag occuring "randomly" slowing down indicators, most of the time it is unnoticed and only comes out on high tick volume charts during busy hours, when the volume is highest. It is small lag that is compounded with each tick. That's all I can figure out. There was no such issues with MT5 until few months ago. It's either MT5 or MQL5 compiler, not your indicator or EA.

Don't worry about Alain complaining on me, I couldn't give him what he's asking me for and we had a row, no big deal. I'm sure he will help you as much as he's able to.

 
Dadas #:
I got a hint from P4L yesterday.
He posted a link to his earlier thread on FF:
https://www.forexfactory.com/thread/1210964-mt4-slow-test-if-your-onchartevent-is-compatible
This lead me to check the OnChartEvent() function in my AVWAP.
I removed the parts associated with CHARTEVENT_OBJECT_DELETE and the unnecessary if() statement which was at the top, inside OnChartEvent().
Maybe it's too early to judge definitely, but the symptom didn't occur after that.
BTW, the parts I removed were added by AI, and I had ignored them before.
I wasn't aware that this may cause such side effects.
However, I was aware that the OnChartEvent() function does provide a backdoor, so...
Running this further today:

I will wait your definitive feedback before investing more time on the issue.
 
Alain Verleyen #:
I will wait your definitive feedback before investing more time on the issue.


Happened again...

Nothing special in the Journal.

 
Dadas #:


Happened again...

Nothing special in the Journal.

Ok I will run your code and see if I can find something.

It's all on one chart right ? Nothing else running ?

 
Alain Verleyen #:

Ok I will run your code and see if I can find something.

It's all on one chart right ? Nothing else running ?

Correct, one chart running.
Also, I removed the EA and looking if I will get this symptom without the EA.
 
Dadas #:
Correct, one chart running.
Also, I removed the EA and looking if I will get this symptom without the EA.

Default parameters ?