MetaEditor: autocompletion displays

 

Good morning,

I'm encountering an annoying limitation in MetaEditor.

In one class, I declare a pointer to another class:

Check_Historical_Data * Pointer_Check_Data;

When I write this.Pointer_Check_Data. in the editor, auto-completion offers me the private members and methods of Check_Historical_Data , which it shouldn't.

This behavior is confusing because it blurs the distinction between public interface and encapsulation. Would it be possible to improve MetaEditor's introspection so that it respects member visibility when accessing via pointer?

Thanks in advance.

 
I also have another issue, and I'm up to date on version 5260.

I'm using a custom structure, for example:

struct Struct_Example {

int ID;
double Value;
string Label;
};

And I declare a two-dimensional array of this structure in a class:

Struct_Example Matrix[ 10 ][ 10 ];

When I access an element like this:

this.Matrix[ 0 ][ 0].

The editor doesn't offer any completion—no members of the structure appear (ID, Value, Label, etc.), even though they are accessible and the code compiles without errors.

Note: if I declare a simple instance of the structure (outside the array), completion works perfectly. The problem therefore seems to be related to introspection on 2D arrays of structures.

This behavior makes development more laborious, especially in modular architectures. Is this a known bug or a current limitation of MetaEditor?

Thank you in advance for your feedback.
 

What you’re seeing is not really a bug in the compiler, but more of a limitation in how MetaEditor’s auto-complete works.

When you work through a pointer to a class, the editor will still show private members in the suggestion list, even though you cannot actually call them. The compiler will reject the code if you try, so it’s only an IntelliSense quirk. The only way around it is to hide the pointer behind an interface or a wrapper that only exposes the methods you actually need. That way the editor only proposes the public surface and the suggestions look cleaner.

With the structure array problem it’s the same story. If you declare a two-dimensional array of a struct and try to access an element with Matrix[i][j]. , the editor won’t suggest any members. The code is valid and compiles fine, you can type ID or Value manually and it will work, but completion just doesn’t kick in. If you first assign the element to a reference or pointer, completion suddenly works again. For example:

Struct_Example &cell = Matrix[i][j];
cell.ID = 123;   // members are now suggested

You can also wrap the access in a helper function that returns the element by reference, and again you’ll get normal completion when using it.

So both issues come down to the same thing: MetaEditor’s introspection is a bit limited. The code itself is fine, it runs and compiles correctly, but the editor doesn’t always know how to display the members. If it bothers you a lot, the best thing you can do is send feedback to MetaQuotes. Until then, small workarounds like using references or interfaces are usually enough to make coding less painful.

 
Matei-Alexandru Mihai # :
he best thing you can do is send feedback to MetaQuotes

I don't even know how to do that.

Thank you for your response, even if it was more of an observation on my part to say that the editor's limitations are present in certain cases.

 

Matei-Alexandru Mihai #:
If you first assign the element to a reference or pointer, completion suddenly works again. For example:

Struct_Example &cell = Matrix[i][j];
cell.ID = 123;   // members are now suggested

How often do you personally declare references in your MQL code?

 
Vladislav Boyko #:

How often do you personally declare references in your MQL code?

Personally I don’t overuse references in MQL. I bring them in when it makes sense, for example to avoid copying a bigger struct, or when I want clean access like

auto &cell = Matrix[i][j];


. In that case it also has the side effect of fixing the completion issue.

For simple types I just use plain values, and if I need something that can be reassigned or nullable then I’ll go with a pointer. So references are part of the toolkit, but only where they add value.

 
Matei-Alexandru Mihai #:

Personally I don’t overuse references in MQL. I bring them in when it makes sense, for example to avoid copying a bigger struct, or when I want clean access like

auto &cell = Matrix[i][j];

. In that case it also has the side effect of fixing the completion issue.

For simple types I just use plain values, and if I need something that can be reassigned or nullable then I’ll go with a pointer. So references are part of the toolkit, but only where they add value.

MQL does not support references. Code like your examples cannot be compiled. Your posts are AI generated and you yourself do not understand what you are posting. You are misleading users who don't know you are posting bullshit.

 
Vladislav Boyko #:
MQL does not support references
?

I m a lier ?
 
Gerard William G J B M Dinh Sy #:
?

I m a lier ?

Please clarify what you mean

 
Vladislav Boyko #:

Please clarify what you mean

I'm asking you if I'm a liar? 

Since MQL doesn't support references. 

That I don't have any compilable code since it's generated by AI and it's pure crap.
 
Gerard William G J B M Dinh Sy #:
I'm asking you if I'm a liar? 

Since MQL doesn't support references. 

That I don't have any compilable code since it's generated by AI and it's pure crap.

You probably didn't notice that my first 2 posts in this thread weren't addressed to you.

[edit]

Gerard William G J B M Dinh Sy #:
Since MQL doesn't support references.

You cannot declare reference as shown below and such code cannot be compiled:

Forum on trading, automated trading systems and testing trading strategies

MetaEditor: autocompletion displays

Matei-Alexandru Mihai, 2025.09.06 12:32

For example:

Struct_Example &cell = Matrix[i][j];
cell.ID = 123;   // members are now suggested