Learning and writing together in MQL5 - page 27

 
Khomtchenko:

Can you tell me what those green bars at the bottom mean? In MT4 they meant lot volume and were drawn when the lot changed. But what is it for here? Or my lot volume changes? It seems that I do not change it.

It says so in the upper left corner: "Margin level."

 

Another question: judging by the tester's chart, there are many times fewer market entries on mql5 or the tester shows the results of several trades in a generalized or smooth manner. Well, the test results are different and that's it!

By the way, I've heard a lot of clever things like "wipe the headlights", "tap the wheel" and EAs but nobody has explained me anything in particular or pointed out my errors. I will also summarise in one report all comments made by moderators and experts to make it clear whether the super product mql5 has normal technical support.

 
Khomtchenko:
By the way, I listened to a lot of clever things like "wipe the headlights" and "tap the wheel", I posted EAs, but no one specifically explained anything to me and did not point out my mistakes. I will also summarize all comments made by moderators and experts in one report to make it clear whether the super product mql5 has a decent technical support.

Have you attached the tester's staff reports in zip format to your posts?

As soon as you take a look at them yourself and do a post-process analysis, you will understand everything at once. There's no need to waste time on superficial estimates like "the totals and the number of deals do not add up".

You have been given the way to find it: check the history (you are relying on the mistaken belief that the history is the same everywhere) and post-processing.

Документация по MQL5: Торговые функции / HistoryDealsTotal
Документация по MQL5: Торговые функции / HistoryDealsTotal
  • www.mql5.com
Торговые функции / HistoryDealsTotal - Документация по MQL5
 

The latest build has introduced constructors with parameters. Thanks a lot to the developers!

But an issue has arisen when inheriting such constructors. When compiling the following code an error "clsBase - wrong parameters count" occurs and the compiler points to the red bold line:

class clsBase {
    protected:
        string __strSymbol;
        ENUM_TIMEFRAMES __enumTF_thisTF;

    public:
        void clsBase(int intX);
        void ~clsBase();
};


void clsBase::clsBase(int intX) {

}


class clsInherit:public clsBase{

    public:
        void clsInherit(int intX,double dblY);
        void ~clsInherit();
};


void clsInherit::clsInherit(int intX,double dblY):clsBase(int intX){

}

Moreover, if you comment out the green bold line, the compilation proceeds without errors.

I.e. if it's not a bug, I'm declaring the constructor of an inherited class incorrectly.

Nothing new in the help so far, i.e. it says about constructors with parameters that they are not possible.

Please explain syntax of constructor call with parameters for inherited class.

 

Try it this way:

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
class clsBase
  {
protected:
   string            __strSymbol;
   ENUM_TIMEFRAMES   __enumTF_thisTF;

public:
   void              clsBase(int intX);
   void             ~clsBase() {};
  };
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void clsBase::clsBase(int intX)
  {
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
class clsInherit:public clsBase
  {
public:
                     clsInherit(int intX,double dblY):clsBase(intX)
     {
     }
                    ~clsInherit()
     {

     }
  };
 

I've already tried it!

All the same

void clsInherit::clsInherit(int intX,double dblY):clsBase(intX)

void clsInherit::clsInherit(int intX,double dblY)


The compiler says the same thing

PS While writing this, your post was updated. I will try again now.


PPS Tried it, but it's the same as what I wrote before, i.e. with no constructor body the compilation goes through.

But I don't need to write constructor in class declaration body, I just need to declare it there and write constructor body itself (I have long one) further, as it's usually done.

In other words, I'll repeat the question :)

The syntax to call a constructor with parameters in an inherited class?

 
falkov:

But I don't need to write constructor in class declaration body, I just need to declare it there and write constructor body itself (I have long one) further, as it's usually done.

In MQL5 it is recommended not to split classes into MQH/MQ5 files and not to separate description from implementation in one file, but to write the body directly in the class block.


The syntax of a constructor call with parameters in an inherited class?

The above bug has already been fixed - will be available in the next build. It will be possible to take implementation of complex constructors outside of class description block.


ps: my example code compiles fine, I checked

 

Your example compiles without errors, that's what I said, but that's not what I need.

Thanks for the next build, looking forward to it!

 
Have you attached the tester's staff reports in zip format to your posts?

I've laid out the advisers for you. See anything you like! 10 seconds to compile and test another 1 minute. You want object properties and I give you the whole object.

You get different results, and the results are dramatically different. The Expert Advisors have a very small code. A couple of standard functions to open a position and 4 lines of the strategy itself.

Ok. Is there any other site where mql5 product developers can stand behind their development? There is no help here. Just excuses. Like you can figure it out on your own... THANK YOU ALL.

Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Свойства объектов
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Свойства объектов
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы объектов / Свойства объектов - Документация по MQL5
 
Khomtchenko:

Is there any other site where mql5 product developers can stand up for their development?

There is no help here. There are only excuses. Like you'll figure it out on your own...

First of all, these are your development experts.

Second, if you are lazy, why should others do the same?

Reason: