Errors, bugs, questions - page 610

 

Hello.

Switching from 4 to 5. I can't understand the following question. I have prescribed my class in the include file, then I use it in the Expert Advisor. Then I want to create another Expert Advisor and I need the same class. Do I need to create another include file or the terminal will create a copy of the existing one and hook it properly to another EA (like functions libraries in MQL4)? Can classes be registered in libraries and used together with several Expert Advisors (like the function libraries in MQL4)? I have downloaded the certificate for 5-th, but I haven't found any detailed description of this procedure. May be, there is something to read that would help me understand it?

Thanks in advance.

 

RedFish:

Do I have to create another include file or the terminal will create a copy of the existing one and hook it correctly to another EA (like functions libraries in MQL4)?

When creating a class in an external file, make the file with the extension mqh instead of mq5 and then include this file into your project of any expert/script/indicator

Can you add classes to libraries and use them simultaneously with several EAs (like function libraries in MQL4)?

Of course! Do it that way.

 
sergeev:

When creating a class in an external file, make this file with the extension mqh instead of mq5 and connect this file to any of your EA/Script/indicator projects through include.

of course! Do it that way.

Thanks for the answer.

How to hook up libraries with classes to an Expert Advisor? In MQL4, there was the #import operation - I listed the functions - #import, closed it and everything worked. In MQL5, how does this procedure work? I can't find a description of this process anywhere ...

Thanks again.

 
RedFish:

Thanks for the answer.

How to hook up libraries with classes to an Expert Advisor? In MQL4, there was the #import operation - I listed the functions - #import, closed it and everything was working. In MQL5, how does this procedure work? I can't find a description of this process anywhere ...

Thank you again.

These points are described in details in Help: https://www.mql5.com/ru/docs/basis/preprosessor
Документация по MQL5: Основы языка / Препроцессор
Документация по MQL5: Основы языка / Препроцессор
  • www.mql5.com
Основы языка / Препроцессор - Документация по MQL5
 
Terminal: При авторизации в журнал терминала выводится информация о времени и адресе предыдущего успешного подключения.

This implementation leads to a security breach - it reveals the IP address of the trader if he/she suddenly decided to give the Invest password to someone else. I checked - the IP is shown to everyone, regardless of whether and how they connected using their trading password or investor password.

Thus, the IP of the last connection (irrespective of whether the last connection was made with Investor or Trade password) is shown when logging in (irrespective of whether the last connection was made with Investor or Trade password).

You must disable this feature for the investor password and only consider logins using the trade password.

 
notused:

This implementation leads to a security breach - it reveals the IP address of the trader if he/she suddenly decided to give the Invest password to someone else. I checked - the IP is shown to everyone, regardless of whether and how they connected using their trading password or investor password.

It means that the IP of the last connection (irrespective of whether the last connection was made with Investor or Trade password) is shown when logging in (irrespective of whether the last connection was made with Investor or Trade password).

You must disable this feature for the investor password and only consider logins using the trade password.

Yes, that will be fixed - already seen.
 
      ObjectSetInteger(0,highlevel,OBJPROP_TIMEFRAMES,OBJ_PERIOD_M10|OBJ_PERIOD_H4);
How can I prepare in advance a string with logical(?) enumeration like: OBJ_PERIOD_M10| OBJ_PERIOD_H4, to then just substitute in ObjectSetInteger () ready variable in the form of glued string? I tried to glue it together symbolically and then wrap it in StringToInteger(), but it did not work... BecauseOBJ_PERIOD_... - is an element of enum type but has the flag hex-equivalent of int type? This enumeration looks more like bitwise OR operation...
 
x100intraday:
How can I prepend a string with boolean(?) enumeration like: OBJ_PERIOD_M10| OBJ_PERIOD_H4, so that I can just substitute a ready variable in ObjectSetInteger () as a glued string? I tried to glue it together symbolically and then wrap it in StringToInteger(), but it did not work... BecauseOBJ_PERIOD_... - is an element of enum type but has the flag hex-equivalent of int type? This enumeration looks more like bitwise OR operation...

Would it work with #define?

Example:

#define Fl_Fnc __FILE__+" -> "+__FUNCTION__+"(): "
 
tol64:

Would it work with #define?

Example:

I'm afraid to imagine how. Actually, I need a flexible variant, I don't need one string in unchanged form, but several different strings to form, in a loop... If it's possible, I'd like to see a more specific example...

In fact, the question comes down to something else. I want to know if it is possible in principle to get actual OBJ_PERIOD_M30 as an enum element from a string that contains a reserved word of the " OBJ_PERIOD_M30 " type and actually contains int-value on which you can perform operations like |? This is a simple case. But I want to immediately interpret any line of the form "OBJ_PERIOD_M15|OBJ_PERIOD_M30|OBJ_PERIOD_H1" as a bitwise operation with numerical values without entering an additional array of corresponding numerical values and subsequent element-by-element "identification" with a list.

 

Good afternoon, please advise, I need to use this construction void RAssignStringVector(int rhandle, string variable, string &vector[], int size);

I get the error 'vector' - invalid parameter for import function mt4R.mqh, how can i pass a pointer to an array of strings, it works in µl4, not in 5, what should i do in this situation?

Reason: