Download MetaTrader 5

Standard library

To add comments, please log in or register
kemalturgay
265
kemalturgay  

As a newbie in OOP, I would like to ask a question about the object oriented structure of MQL5.


I'm reading the reference now and there is a section describing the standard library of MQL5.

But, none of the predefined functions described earlier in the reference are in the standard library.

And, we use these functions without an #include directive.


I would like to ask ... where these predefined functions (for example OrderSend, Print, Alert etc.) are in the object oriented structure of MQL5? 

Stanislav Korotky
23152
Stanislav Korotky  
kemalturgay:

As a newbie in OOP, I would like to ask a question about the object oriented structure of MQL5.


I'm reading the reference now and there is a section describing the standard library of MQL5.

But, none of the predefined functions described earlier in the reference are in the standard library.

And, we use these functions without an #include directive.


I would like to ask ... where these predefined functions (for example OrderSend, Print, Alert etc.) are in the object oriented structure of MQL5? 

No, they are built in functions of MQL5. You can easily distinguish OOP and non-OOP parts by presence of a class or object context. For example, OrderSend() is used as a standalone method. But something like t.PositionOpen(...), where t is declared as an object of class (supposedly CTrade in this case) you are in OOP.
kemalturgay
265
kemalturgay  
marketeer:
No, they are built in functions of MQL5. You can easily distinguish OOP and non-OOP parts by presence of a class or object context. For example, OrderSend() is used as a standalone method. But something like t.PositionOpen(...), where t is declared as an object of class (supposedly CTrade in this case) you are in OOP.

Ok, thanks ... I'm not an experienced programmer, I just have some background in C++.

In C++, there are also some predefined functions but we need to include a header for using them.

So, I thought that there also should be a file for built-in functions in MQL ... but we use them without including any file.

I would like to ask where the definitions of these built-in functions are in MQL?

Stanislav Korotky
23152
Stanislav Korotky  
kemalturgay:

Ok, thanks ... I'm not an experienced programmer, I just have some background in C++.

In C++, there are also some predefined functions but we need to include a header for using them.

So, I thought that there also should be a file for built-in functions in MQL ... but we use them without including any file.

I would like to ask where the definitions of these built-in functions are in MQL?

This is one of several differences between MQL and C++. Built-in function do not require includes here. They are implemented in the core (C++) and implicitly "linked" with all your code.
kemalturgay
265
kemalturgay  
Thanks marketeer, clear now.
To add comments, please log in or register