Errors, bugs, questions - page 1704

 
Stanislav Korotky:
That's how it should be, aren't you confused? You have a protected specifier, it defines methods as available in descendants.
With protected inheritance, public methods of the base class become protected in the derived class.
 
Sergei Vladimirov:
With protected inheritance, public methods of the base class become protected in the derived class.
Exactly. Protected accesses in the derived one.
 
Stanislav Korotky:
Exactly. Protected accesses in a derivative.
Well, make a protected method call from an object.
 
Alexey Kozitsyn:
Yes, what a class instance has after the point and what the class itself has after this.

In short, like this:


It's good when you know the names of the methods. And if you don't? Should we open a file and see what's there?

Maybe some people find it convenient but hardly many...

 
Artyom Trishkin:

Did Ctrl+Space ever display a list of available methods?

Ctrl+Space works as always, and so does Ctrl+Shift+Space, and they didn't break.

It's the intelligences after the dot that don't work.

The list of members opens after the dot. Build 1430.
 
Artyom Trishkin:

In short, like this:


It's good when you know the names of the methods. And if you don't? Open the file and see what is there?

May be convenient to someone, but I don't think many...

Why in the area of global variables? It logically should not be opened there at all because it is not needed.

Try it in OnTick, for example.

 
Alexey Volchanskiy:

And why in the area of global variables? logically, it should not open there at all, because there is no need to

try it in OnTick, for example

It makes no difference. It is the same everywhere.
 

Here is an array

array = 0|-5|-14|49|35|-7|-15|48|36|99|67|70|90|107|170|233|296|269|243|237|223|220|200|196|195|199|262|265|298|

how to find the maximum drawdown ?

Initial value 0 !
 
Stupid. Can you tell me why I can't do that?
class A
{
};

class B
{
  A* Data[];
  
  B()
  {
    ArrayResize(this.Data, 1);
  }

  A* operator []( const int Pos )
  {
    return(this.Data[Pos]);
  }
  
  void Init()
  {
    A* a = this[0];
    a = new A; // так работает
    
    this[0] = new A; // а так - нет
  } 
};
 
Itum:

Here is an array

array = 0|-5|-14|49|35|-7|-15|48|36|99|67|70|90|107|170|233|296|269|243|237|223|220|200|196|195|199|262|265|298|

how to find the maximum drawdown ?

Initial value is 0 !
double MIDD(double& fEquity[])
{
        double fMaxEquity = 0;
        double fMIDD = 0;
        
        for(int i = 0; i < ArraySize(fEquity); i++)
        {
                fMaxEquity = MathMax(fMaxEquity, fEquity[i]);
                fMIDD = MathMax(fMIDD, fMaxEquity - fEquity[i]); // это в деньгах,
                                                                 // если нужно в процентах, то так:
                fMIDD = MathMax(fMIDD, (fMaxEquity - fEquity[i]) / fMaxEquity * 100);
        }
        
        return fMIDD;
}
fEquity[] is your array.