Download MetaTrader 5

Standard library

To add comments, please log in or register
Does your signal already have a lot of of subscribers? It's time to think about the paid subscription!
kemalturgay
265
kemalturgay 2014.10.22 22:01 

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
17922
Stanislav Korotky 2014.10.27 14:08  
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 2014.10.27 18:15  
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
17922
Stanislav Korotky 2014.10.27 19:57  
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 2014.10.28 21:43  
Thanks marketeer, clear now.
To add comments, please log in or register