Errors, bugs, questions - page 1397

 
Ilya Malev:

And secondly, we need to use this indicator buffer value in other indicators and Expert Advisors,

and something tells me that if you make a buffer for calculations, it will be impossible to get its value through iCustom.

By the way, I do not remember exactly, but it seems to be possible. Give it a try. )
 
Anatoli Kazharski:
By the way, I don't remember exactly, but I think you can. Give it a try. )
Even so, I have a dozen of indicators with attributes like DRAW_NONE calling one another, and then I already need some separate subsystem grouping in one place readings from all working indicators by mouse pointer position. :)
 
Ilya Malev:
Even so, I have a dozen indicators with attributes like DRAW_NONE calling one another, and then I already need some separate subsystem that groups in one place readings from all working indicators by mouse pointer position. :)
This argument is more serious. We could add it into service Desk. ))
 
If you can get values like INDICATOR_CALCULATIONS through iCustom, then yes, all you need to do is to allow these values to appear in the data window. If I get an answer to my request from servicedesk, I'll suggest this option.
 
A100:
Compilation error:'a' - is not static member
but that's OK. What's the difference?

//должен обращаться к функции, хотя бы потому что уж стоят скобки и тип, да еще a базового класса приватный
class A     { int a; };
class B : A { void a(); };
void B::a() {}
// здесь инлайнится, все правильно
class A     { int a; };
class B : A { void a() {} };
// так работает, видно проблема с компилятором
class A     {int h; void f(); };
class B : A {void a(); };
void B::a() {}
 

I don't know about you, but I already see several compiler errors.

1) it doesn't distinguish between functions and variables when inheriting.

2) the variable of the base class is private, so first the message that it is impossible to access the private members should come out

 
sigma7i:

I don't know about you, but I already see several compiler errors.

1) it doesn't distinguish between functions and variables when inheriting.

2) the variable of the base class is private, so first the message that it is impossible to access the private members should come out

Please cite some examples. It would be interesting to see what particular cases cause such problems in terms of code formatting.
 
Anatoli Kazharski:
Give me some examples. It is interesting to see in which cases such problems in terms of code design.

I think I've already given examples. But I will make it more detailed to make it even clearer:

Note that in the third example in class A I replaced the variable name with "h" and this code compiles (of course if you comment out 1 and 2 examples), which confirms my hunch.

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



//должен обращаться к функции, хотя бы потому что уж стоят скобки и тип, да еще a базового класса приватный
class A     { int a; };
class B : A { void a(); };
void B::a() {}
// здесь инлайнится, все правильно
class A     { int a; };
class B : A {void a() {} };
// так работает, видно проблема с компилятором
class A     {int h; void f(); };
class B : A {void a(); };
void B::a() {}


void OnStart()
  {
    // c объектами работает правильно
  
    B variable;
    variable.a();   // ошибка доступа, здесь все нормально
    variable.a = 1; // ошибка доступа, как и следовало ожидать, здесь все нормально
  }
//+------------------------------------------------------------------+
 

Situation: the test is on H1 (I think it is important - we are talking about a multi-period test). The last daily (D1) bar in the tester SeriesInfoInteger gives for example 2015.10.08. I take the iMA indicator on D1 with an offset of 2. It gives the value for 2015.10.05 (which should be 2015.10.06 with an offset of 2).

It means that the indicator lags in the tester compared to time series creation. It happens clearly at the start of a new D1 bar. Has anyone experienced such a situation? I will not simulate the example yet.

 
Ilya Malev:

Situation: The test is on H1. The last daily (D1) bar in the tester SeriesInfoInteger gives for example 2015.10.08. I take iMA indicator readings with an offset of 2. It gives the value for 2015.10.05 (which should be 2015.10.06 with an offset of 2).

That is, the indicator lags in the tester compared to the construction of the timeseries. Has anyone had this happen? I am not going to simulate an example yet.

Yes, that may happen when working with the TF, as far as I remember, only older than the current one in the tester. The data have not had enough time to be updated. I.e., when it is a new day on H1, the previous day is on the first tick of this new day on D1.