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

 

Andriy Moraru #:
Same result:

void OnInit(

"OnInit() function of void type always means successful initialization and is not recommended for use" (https://www.mql5.com/en/docs/event_handlers/oninit).

Dadas #:
So, it's advisable to first sign in to the new account symbol:

int OnInit()

Using an int, at least you get a meaningful return value for diagnostics.

 
Dadas #:
Isn't the purpose of a forum to help each other?
So, if one person has the time and shares a chat with AI, why is that prohibited?
You could allow only Meta Editor AI Assistant, if you don't want other AIs, here, for example. 

BTW, None of us know everything, or are able to think of everything.
So, useful hints can be provided by AI.
I don't see the logic behind prohibiting AI messages, here.

We don't care which AI is used.

Don't you understand where we are going if there is no restrictions on posting AI answer here (most of the time silently) ? The AI system will "eat" all of that on his next iterations, feeding himself with their own answers.

And these answers are far from being correct. And I (or any human) can't start to argue about all what you posted from an AI and which is either wrong, incomplete or misleading.

You can't not understand the logic, but it's not negotiable. 

 
Alain Verleyen #:

We don't care which AI is used.

Don't you understand where we are going if there is no restrictions on posting AI answer here (most of the time silently) ? The AI system will "eat" all of that on his next iterations, feeding himself with their own answers.

And these answers are far from being correct. And I (or any human) can't start to argue about all what you posted from an AI and which is either wrong, incomplete or misleading.

You can't not understand the logic, but it's not negotiable. 

OK, ok...
Anyways, my indicators, without the EA, have been running half a day yesterday and all day today, and no errors appeared, and I didn't notice any issues.
So, now it looks like the EA causes the indicators to run slow??? 
 
Dadas #:
OK, ok...
Anyways, my indicators, without the EA, have been running half a day yesterday and all day today, and no errors appeared, and I didn't notice any issues.
So, now it looks like the EA causes the indicators to run slow??? 
And when I add the EA, I don't need to wait very long.
The chart freezes, even if there are no error prints in the log...
 
Dadas #:
And when I add the EA, I don't need to wait very long.
The chart freezes, even if there are no error prints in the log...

If you don't mind disclosing your EA code, one of us might be able to diagnose it.

In my experience, some of the usual culprits are repeated calls to the same form of current time within OnTick(), for example.

 
MetaQuotes:

The MetaTrader 5 platform update will be released on Friday, July 31, 2026.

We have conducted a comprehensive analysis and audit of the platform's code, resolved any identified issues, and implemented numerous internal improvements aimed at enhancing the stability, reliability, and performance of MetaTrader 5.

In addition, we have made several improvements to the platform components:

  1. Terminal: Expanded the set of MCP methods that AI Assistant is able to use. In particular, it can now add indicators to the chart, as well as get a list of available indicators with their parameters.
  2. Terminal: Fixed bugs and improved built-in AI Assistant functionality.
  3. Terminal: Disabled AI Assistant in Windows 7. This OS version is outdated and does not support all the necessary functions.
  4. Terminal: Fixed support for Windows 7. If you are unable to launch the previous version of the platform, do not uninstall it, just reinstall the new version on top. All settings will be saved.
  5. Terminal: Fixed signal showcase rendering.
  6. Updated Python integration package. To install the update, run the command:
  7. Updated interface translations.

MetaTrader 5 Web Terminal

  • Fixed display of the Depth of Market changes.


The update will be delivered through the Live Update system.

That thing with the new AI Assistant in build 6090 is a blessing and a curse.


Just like @Toh4iem9 mentioned, it sometimes just goes wild, opens up the Strategy Tester, or messes around with the code if you aren't careful—almost like an overly eager intern. You really have to set explicit boundaries for the assistant and forbid it from touching files on its own when you just want an analysis.

On the flip side, when working on EA developments, you notice that the expanded MCP methods, allowing it to drop indicators directly onto the chart, are super handy once you properly control the workflow. But you definitely have to get used to this high level of autonomy first.

 
Lukas Szyry #:

That thing with the new AI Assistant in build 6090 is a blessing and a curse.


Just like @Toh4iem9 mentioned, it sometimes just goes wild, opens up the Strategy Tester, or messes around with the code if you aren't careful—almost like an overly eager intern. You really have to set explicit boundaries for the assistant and forbid it from touching files on its own when you just want an analysis.

On the flip side, when working on EA developments, you notice that the expanded MCP methods, allowing it to drop indicators directly onto the chart, are super handy once you properly control the workflow. But you definitely have to get used to this high level of autonomy first.

So, tell the AI to create a separate copy of your code, so that you don't get confused, and can always verify.
And set the boundries of what you don't allow it to do!
You must tell the AI: "Don't mess with the code which is already working fine!"
"Don't add anything I didn't ask you to add or change!"

IOW, you can't treat the AI as the thing that knows better than you.
AI is a probability algorithm, it doesn't know anything, it just predicts the next word, always.
So, it's a good assistant in the sense that it does the tedious coding jobs, but in the end, we still must be able to verify.
The problem arises when we don't have enough coding skills to be able to verify a specific code.
 
Ryan L Johnson #:

If you don't mind disclosing your EA code, one of us might be able to diagnose it.

In my experience, some of the usual culprits are repeated calls to the same form of current time within OnTick(), for example.

Alain Verleyen already has all my source codes.
This is already more than I was ever prepared to give away.
But, any good coder could have come up with the same or similar ideas, so...
And, the EA was first built for MT4, and I use it every day, and have been using it for quite a few years, and such problems never occured.
So, if the problems don't occur on MT4, they shouldn't occur on MT5.
That's why some other people complian the way they complain about MT5 and claim that it's an MT5 problem, not a coding problem.
However, now my conclusion is that MT5 requires a different coding approach, because such things on a trading platform are unacceptable.
 
Dadas #:
Alain Verleyen already has all my source codes.
This is already more than I was ever prepared to give away.
But, any good coder could have come up with the same or similar ideas, so...
And, the EA was first built for MT4, and I use it every day, and have been using it for quite a few years, and such problems never occured.
So, if the problems don't occur on MT4, they shouldn't occur on MT5.
That's why some other people complian the way they complain about MT5 and claim that it's an MT5 problem, not a coding problem.
However, now my conclusion is that MT5 requires a different coding approach, because such things on a trading platform are unacceptable.

I checked one indicator code in depth, and I will stop wasting my time from there.

The verdict is clear : the quality of the code is very poor and the efficiency from a speed execution is just catastrophic. This indicator is flooding the platform with useless statement on each tick. 

Running such code on EACH tick is not free :

 ...
     if(ObjectFind(ChartID(),ButtonName)==-1)
         createButton(ButtonName,ButtonText,btn_Subwindow,btn_corner,btn_Width,btn_Height,btn_Font,btn_FontSize,btn_background_color,btn_border_color,VLineClr);
...
void createButton(string buttonID,string buttonText,int wind, ENUM_BASE_CORNER crnr, int width2,int height,string font,int fontSize,color bgColor,color borderColor,color txtColor)
  {
   ObjectDelete(0,buttonID);
   ObjectCreate(0,buttonID,OBJ_BUTTON,wind,0,0);
   ObjectSetInteger(0,buttonID,OBJPROP_COLOR,txtColor);
   ObjectSetInteger(0,buttonID,OBJPROP_BGCOLOR,bgColor);
   ObjectSetInteger(0,buttonID,OBJPROP_BORDER_COLOR,borderColor);
   ObjectSetInteger(0,buttonID,OBJPROP_BORDER_TYPE,BORDER_RAISED);
   ObjectSetInteger(0,buttonID,OBJPROP_XSIZE,width2);
   ObjectSetInteger(0,buttonID,OBJPROP_YSIZE,height);
   ObjectSetString(0,buttonID,OBJPROP_FONT,font);
   ObjectSetString(0,buttonID,OBJPROP_TEXT,buttonText);
   ObjectSetInteger(0,buttonID,OBJPROP_FONTSIZE,fontSize);
   ObjectSetInteger(0,buttonID,OBJPROP_SELECTABLE,false);
   ObjectSetInteger(0,buttonID,OBJPROP_CORNER,crnr);
   ObjectSetInteger(0,buttonID,OBJPROP_HIDDEN,true);
   ObjectSetInteger(0,buttonID,OBJPROP_XDISTANCE,9999);
   ObjectSetInteger(0,buttonID,OBJPROP_YDISTANCE,9999);
   ObjectSetInteger(0,buttonID,OBJPROP_STATE,true);
  }

Mixing Get and Set statement is costly (and perfectly useless in this case) :

      if(!(bool)ObjectGetInteger(ChartID(),VLineName,OBJPROP_SELECTED))
         ObjectSetInteger(ChartID(),VLineName,OBJPROP_SELECTED,true);

      TimeStart=(datetime)ObjectGetInteger(ChartID(),VLineName,OBJPROP_TIME);

These are just 2 examples among numerous ones on 1 indicator, 

MT5 and MQL5 are giving a lot of freedom to coders, it's their responsibility to run efficient code. MT5 is not MT4, it's a lot more powerful but there is a price to pay, you need to know how to use it properly. Your conclusion is plain wrong. This is NOT an MT5 problem, the platform is as it is and you need to deal with. Expecting the developers will change it to meet your needs is illusory.

AI can give you indicator or EA that will provide you the expected "output" results, AI can not give you high quality code if you don't provide them strict rules to follow.

Case closed on my side.

 
Alain Verleyen #:

I checked one indicator code in depth, and I will stop wasting my time from there.

The verdict is clear : the quality of the code is very poor and the efficiency from a speed execution is just catastrophic. This indicator is flooding the platform with useless statement on each tick. 

Running such code on EACH tick is not free :

Mixing Get and Set statement is costly (and perfectly useless in this case) :

These are just 2 examples among numerous ones on 1 indicator, 

MT5 and MQL5 are giving a lot of freedom to coders, it's their responsibility to run efficient code. MT5 is not MT4, it's a lot more powerful but there is a price to pay, you need to know how to use it properly. Your conclusion is plain wrong. This is NOT an MT5 problem, the platform is as it is and you need to deal with. Expecting the developers will change it to meet your needs is illusory.

AI can give you indicator or EA that will provide you the expected "output" results, AI can not give you high quality code if you don't provide them strict rules to follow.

Case closed on my side.

OK, no problem.
However, I don't understand how checking if an object exists and recreating it if it doesn't, is a costly problem?
How else do you recreate an object if it gets deleted somehow, like in this case, where it got deleted by MT5?

Same goes for the SELECTED case.
I need the line to be selected all the time.
How do I do that? Or is it simply impossible in MT5?
For example, in MT4 I am using this to reset the line.
When the line is SELECTED = false, it gets reset automatically.
Why am I not allowed to do the same in MT5???

BTW, I do appreciate You taking your precious time to inspect my codes!