What is STRUCT_POSITION SPosition[]; ? If it's creating an instance of the structure, why is it a dynamic array? Is it really possible to do this? Why?
I will be very grateful to you for your answer.
Declaring the struct STRUCT_POSITION {\...\} structure is the creation of a user-defined data type. And STRUCT_POSITION SPosition[]; is declaring a variable of the user type. The fact that the variable is an array is indicated by square brackets [] You can declare several variables of the custom type just like any other type.
doublea, b[];
STRUCT_POSITIONPos, SPosition[];// при условии, что структура уже создана.
I'm trying to make a universal base class to always define and call an object of the same class.
And I am making two solutions for testing news. I have a base class CNewsFilter and two inherited CNewsFilterLive and CNewsFilterTester. I want to define a CNewsFilter object in my code. And it will automatically select a class depending on which mode is running. But something does not work. Here is a base class, I left only Init() method for example.
When debugging, it never gets into an inherited class CNewsFilterTester, which should get into according to the base class directive, which I added to the end of the base class code. __MQL5__ is here only as an example. How to do it with the tester is another question. So far, the idea itself does not work - methods of the inherited class are not called. When Init() is called, it does not go to Init() of the inherited class - in this example CNewsFilterTester. Help, please.
I'm trying to make a universal base class to always define and call an object of the same class.
And I am making two solutions for testing news. I have a base class CNewsFilter and two inherited CNewsFilterLive and CNewsFilterTester. I want to define a CNewsFilter object in my code. And it will automatically select a class depending on which mode is running. But something does not work. Here is a base class, I left only Init() method for example.
An inherited class:
And then I call it in my EA code:
When debugging, it never gets into an inherited class CNewsFilterTester, which should get into according to the base class directive, which I added to the end of the base class code. __MQL5__ is here only as an example. How to do it with the tester is another question. So far, the idea itself does not work - methods of the inherited class are not called. When Init() is called, it does not go to Init() of the inherited class - in this example CNewsFilterTester. Please help.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hi Connoisseurs!
Here is the code :
struct STRUCT_POSITION {\...\}
STRUCT_POSITION SPosition[];
Question:
What is STRUCT_POSITION SPosition[]; ? If it's creating an instance of the structure, why is it a dynamic array? Is it really possible to do this? Why?
I will be very grateful to you for your answer.
Declaring the struct STRUCT_POSITION {\...\} structure is the creation of a user-defined data type. And STRUCT_POSITION SPosition[]; is declaring a variable of the user type. The fact that the variable is an array is indicated by square brackets [] You can declare several variables of the custom type just like any other type.
In this entry type, variable,arrayIs there any utility (like WatchDog) for restarting MT5.
Suppose MT5 has closed due to some error. How can I remotely trace this immediately and restart MT5.
I am using MT4bar for MT4. Need something similar for MT5.
Good afternoon.
I'm trying to make a universal base class to always define and call an object of the same class.
And I am making two solutions for testing news. I have a base class CNewsFilter and two inherited CNewsFilterLive and CNewsFilterTester. I want to define a CNewsFilter object in my code. And it will automatically select a class depending on which mode is running. But something does not work. Here is a base class, I left only Init() method for example.
An inherited class:
And then I call it in my EA code:
When debugging, it never gets into an inherited class CNewsFilterTester, which should get into according to the base class directive, which I added to the end of the base class code. __MQL5__ is here only as an example. How to do it with the tester is another question. So far, the idea itself does not work - methods of the inherited class are not called. When Init() is called, it does not go to Init() of the inherited class - in this example CNewsFilterTester. Help, please.
Good afternoon.
I'm trying to make a universal base class to always define and call an object of the same class.
And I am making two solutions for testing news. I have a base class CNewsFilter and two inherited CNewsFilterLive and CNewsFilterTester. I want to define a CNewsFilter object in my code. And it will automatically select a class depending on which mode is running. But something does not work. Here is a base class, I left only Init() method for example.
An inherited class:
And then I call it in my EA code:
When debugging, it never gets into an inherited class CNewsFilterTester, which should get into according to the base class directive, which I added to the end of the base class code. __MQL5__ is here only as an example. How to do it with the tester is another question. So far, the idea itself does not work - methods of the inherited class are not called. When Init() is called, it does not go to Init() of the inherited class - in this example CNewsFilterTester. Please help.
Here
you create a base class object. Accordingly - you have a base class everywhere.
How to write a condition correctly :
like this
or like this:
??
How to write a condition correctly :
like this
or like this:
??
It doesn't really matter. You can even write it this way.
Arithmetical operations take precedence over logical ones.
But if there are both && and || in the condition, it is preferable to separate them with brackets to make it easier to understand.
It's not a matter of principle. You can even put it this way
The priority of arithmetic is higher than that of logic.
But if the condition has both && and ||, it is preferable to divide it by parentheses to make it easier to understand.
Thanks for the answer!
What is the reason I can't publish the code?
I always get a message:
Code review completed with errors:
Errors detected during code verification Trading Statistics Real Time Report.
https://www.mql5.com/en/code/28074/230766
But I don't understand the reason for the code publishing error.
Please answer me on this.
What is the problem, at least it should be highlighted.
What is the reason I can't publish the code?
I always get a message:
Code check completed with errors:
Errors detected during code check Trading Statistics Real Time Report.
https://www.mql5.com/en/code/28074/230766
But I don't understand the reason for the code publishing error.
Please answer me on this.
What is the problem, at least it should be highlighted.
Where is the question? What exactly are the errors? Sorry, all the telepaths are on holiday.