Errors, bugs, questions - page 959

 
//+------------------------------------------------------------------+
//|                                                      ClassEx.mq5 |
//|                        Copyright 2013, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2013, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+


class CClass1
{
   public:
    CClass1(void){};
    CClass1(int i){};
};


class CClass2 : public CClass1
{
   //public:
   // CClass2();

};


void OnStart()
  {
//---
   CClass1 lCC1(0);
  // CClass2 lCC2(0);
   
  }
//+------------------------------------------------------------------+

Good afternoon!

If I remove the //CClass2 comment, I get a "wrong parameters count" error.

It's been asked here before, but the topic has gone deeper into another direction. My question is as follows. I expect CClass2 lCC2(0), should call the base class constructor. This doesn't seem to be happening. What is the problem?

Thanks!!!

Документация по MQL5: Основы языка / Объектно-ориентированное программирование / Наследование
Документация по MQL5: Основы языка / Объектно-ориентированное программирование / Наследование
  • www.mql5.com
Основы языка / Объектно-ориентированное программирование / Наследование - Документация по MQL5
 

Good afternoon.

Yesterday I connected my signal, but today I deleted it. Wanted to subscribe to someone else's signal, but now the system won't let me in. Says, "Already have a signal broadcasting from the specified account. No resale of signals allowed."

My signal is deleted, but now I can't subscribe to someone else's. What to do? Help me!

 
Peretrubator:

My signal has been deleted, but now I can't subscribe to someone else's. What to do? Help me!

Create a new account.
 
ns_k:

Good afternoon!

If I remove the //CClass2 comment, I get a "wrong parameters count" error.

It's been asked here before, but the topic has gone deeper into another direction. My question is as follows. I expect CClass2 lCC2(0), should call the base class constructor. This doesn't seem to be happening. What is the problem?

Thanks!!!

Your CClass2 doesn't have a constructor, so you can't pass the parameter;-)

void OnStart()
  {
//---
   CClass1 lCC1(0);
   CClass2 lCC2();
   
  }
 
NOT TO ENTER THE BRAUSER STORAGE
 
Good afternoon.
How do I calculate the number of refills per position?
 

Good afternoon.

Is there any way in MQL5 to pass a two-dimensional array of unknown dimensions to a function? And how can I search a two-dimensional array?

Thank you.

 
w1sp:

Good afternoon.

Is there any way in MQL5 to pass a two-dimensional array of unknown dimensions to a function? And how can I search a two-dimensional array?

Thank you.

I too have faced the problem of passing a multidimensional array into a function. MQL5 does not seem to be designed for it. Either you use only one-dimensional array or explicitly specify the dimension of the array to be passed in the function, and the flexibility and universality of the function are lost. That's too bad.

MT4 is much more flexible in this respect. And there are no problems in C++ either; you just pass the array's dimensions as additional parameters of a function. However, MT5 has turned out to be some kind of a stump. It is neither here nor there.

Документация по MQL5: Основы языка / Переменные
Документация по MQL5: Основы языка / Переменные
  • www.mql5.com
Основы языка / Переменные - Документация по MQL5
 
meat:

I too have faced the problem of passing a multidimensional array into a function. It seems that MQL5 is not at all suitable for it. Either you use only one-dimensional array or explicitly specify the dimension of the passed array in the function, and the flexibility and universality of the function are lost. That's too bad.

MT4 is much more flexible in this respect. And there are no problems in C++ either; you just pass the array's dimensions as additional parameters of a function. However, MT5 has turned out to be some kind of a wrap. It is neither here nor there.

You can use standard classes, library (CArray) and create an array of arrays.

#include <Arrays\Array.mqh>
   
...

void function(CArray &arr[])
{
...
}

See this article for details.

 

Has anyone asked about XAUUSD yet?

Actually, how to do it on the real? ;-)

This is what my Expert Advisor managed to trade:

Files:
Reason: