Errors, bugs, questions - page 2664

 
Stanislav Korotky:

Does anyone have this compiled?
What's wrong with it?

It's OK, come back for more:

class B {};

template<typename T>
class A
{
    static T *array;
    
    static void check(){
      T *ptr = array; 
    }
};

template<typename T>
static T *A::array;

class Y: public A<B>
{
};

void OnStart()
{
  Y y;
}
definition for static array has been moved above the creation of class Y.
 

Is it now possibleto run optimization+teston all symbols in the market review? Or only without optimization just run with the same parameters is done on the whole review?


That is, you can run a test not only with the same parameters for the symbols in the Market Watch, but optimize them at the same time? Otherwise, the selection of optimization parameters is blocked when all symbols are selected.

Оптимизация стратегий - Алгоритмический трейдинг, торговые роботы - Справка по MetaTrader 5
Оптимизация стратегий - Алгоритмический трейдинг, торговые роботы - Справка по MetaTrader 5
  • www.metatrader5.com
Тестер стратегий позволяет тестировать и оптимизировать торговые стратегии (советники) перед началом использования их в реальной торговле. При тестировании советника происходит его однократная прогонка с начальными параметрами на исторических данных. При оптимизации торговая стратегия прогоняется несколько раз с различным набором параметров...
 
Askr:

Is it now possibleto run an optimisation+teston all the symbols in the market review?

https://www.mql5.com/ru/code/26132

MultiTester
MultiTester
  • www.mql5.com
Бывает, нужно советник прогнать на множестве символов. Для этого в MT5-тестере существует режим "Все символы, выбранные в окне Обзора рынка". Получается прогон одних и тех же настроек советника на разных символах. Но иногда требуется сделать много различных запусков MT5-тестера. Данная библиотека позволяет это. Возможности. Можно задавать...
 
I think I read that this has already appeared in the standard tester?

I would like to know how to run your libraries, it's not clear. After all, you have to specify the Expert Advisor itself in the tester, but how do I launch the library?

Or, do you copy the skiyal to the terminal and everything works by itself?
 
Askr:
Or did you copy the scial into the terminal and everything works by itself?

Yes.

 
Alexey Kozitsyn:
Unable to commit to storage...

Same problem again! Developers, please fix the storage! It's impossible to work with it. Common error.

 
Sergey Dzyublik:

It's OK, come again:

We're in touch. This code works:

class A
{
  protected:
    int field;

  public:
    A() { field = rand(); }
};

class B: public A
{
  public:
    B(A &origin)
    {
      field = origin.field;// это другой экземпляр, C++ дает ошибку 'int A::field' is protected
    }
    int getField(void) const
    {
      return field;
    }
};


void OnStart()
{
    A a;
    B b(a);
    Print(b.getField());
}

But according to C++ rules it should not allow access to protected (field of another object, albeit of the same class; protected denotes access only to inherited fields of the same object, while for access to alien fields it must be public). Is this a bug or a feature?

 
Stanislav Korotky:

We turn. This is the code that works:

But according to C++ rules, it shouldn't allow access to protected at compile time. Is it a bug or a fix?

What do you mean it shouldn't? In what particular place? So your code is public inheritance (i.e. proctored members in descendants become public) and method is public.

s.w. rubbed my eyes, saw where, sorry)
 
Stanislav Korotky:

We turn. This is the code that works:
But according to C++ rules, it shouldn't allow access to protected at compile time. Is this a bug or a fix?

Yes, C++ online swears:https://onlinegdb.com/Hkv1_13EU
That's up to the developers.

 
Sergey Dzyublik:

Yes, C++ online swears:https://onlinegdb.com/Hkv1_13EU
That's up to the developers.

Yes, let's listen to the developers. I have now taken advantage of this convenient hole. If they close it, I'll have to look for other ways.

Reason: