Errors, bugs, questions - page 2472

 

I create a custom symbol and fill it with 25 years' worth of daily bars, this should weigh about 400kb. However, in the symbol folder, .hcc files are created with a total size of 15 mb! On top of that it all takes about 20 seconds! It's out of the question... How do you explain this?

 
Sergey Dzyublik:

I was surprised to find that it was possible to declare typedef with a pointer to a template function.
However, the happiness did not last long.

Which is what I was talking about
 

Dozens of "features" and bugs in the MT have been reported recently.
How do we know whether it's worth waiting for them to be fixed or not?
Please don't suggest testing everything every time a new build is released.

(not fixed in MT5(build 2057)) "Strategy Tester: 2 passes planned, but in practice infinite number of passes > 900pc due to "OnInit critical error" error".
(not fixed in MT5(build 2057))"Invalid value of array size field within default assignment operator for structures with dynamic arrays".
(not fixed in MT5(build 2057))"The compiler does not see the default copy constructor for the class when returning a class object by value from a function".
(not fixed in MT5(build 2057))"Compile bug on type cast "in itself" for pattern classes and "complex" structures".
(not fixed in MT5(build 2057))"When working with typedef, using a template function with explicit specialization does not generate code for this template function".
(not fixed in MT5(build 2057))"Compilation error when reusing the same function signature within typedef".
#
(not fixed in MT5(build 2057))"Major part of string functions don't work with NULL characters in a string (for example: ShortArrayToString, StringInit, StringFill)".
(not fixed in MT5(build 2057))"The StringSetLength function only works to "trim" the string length, not to increase it.
(fixed in MT5(build 2057))"Strategy Tester: 750 "metatester64.exe" processesare running".
#
"Forum www.mql5.com, when editing a message with a picture, the previous picture is not replaced with the new one".


Suggestions:
"Allow user to force code generation/deletion for default assignment operator (copy constructor)".
"Allow ArrayCopy to copy classes and "complex" structures, similar to how structures provide deep copy functionality for any object type".
"Provide functionality for user to read/setCapacity valuewhen working with dynamic arrays".

"Changes to improve infographics of the Signals service"

 
A100:
That's what I was talking about.

Template typedef and using typedef in a template class are different things.
The second option works, but there is a problem with namespace overlap when reusing a template class with a different type.

 
Alexey Navoykov:

I create a custom symbol and fill it with 25 years' worth of daily bars, this should weigh about 400kb. However, the symbol folder creates .hcc files with a total size of 15 mb! And on top of that it all takes about 20 seconds! Out of the question... How can this be explained?

Take a look at what's recorded.

 
fxsaber:

Look at what is recorded.

Well, I don't know the hcc format, so I can't check what's in the file. But in the terminal it shows daily bars. When I switch to a smaller timeframe I see the same bars. Apparently, it saves ALL timeframes into the file initially too, so... I thought only minute bars were saved, from which all other timeframes are then synthesized. And the number of minute bars, as already said, coincides with the daybars, i.e. there are about 7000 minute bars in total.

Therefore, I have an idea that it saves 7000*M1, 7000*M2, 7000*M3, etc., up to 7000*D1 in a file. If so, it will probably fetch 15 MB in total. Correction: about 5 seconds(20 - when updating existing history).

 

Something's broken on the forum site: I can't see my latest posts.
For example,this and this are missing from"All posts"
And it seems the rating used to be over 6000 until a few months ago. Don't know though - maybe the rating may be decreasing over time from less activity.

 
class A{
public:
   struct AA{
      uchar data[8];
   };
   static AA obj;
};

AA A::obj = {0};     // OK


template<typename T>
class B{
public:
   struct BB{
      T data[8];
   };
   static BB obj;
};

template<typename T>
BB B::obj = {0};       //'BB' - declaration without type    




void OnStart(){  
   ArrayPrint(A::obj.data);
   //ArrayPrint(BB<int>::obj.data);
}


It is currently not possible to use a static variable declared inside a template class.
With the introduction of a namespace, can this restriction be bypassed?

 
Sergey Dzyublik:


Currently it's not possible to use a static variable declared inside a template class.
With the introduction of namespace, could this restriction be bypassed?

It's not about the variable. It can't see the BB class. It has to be taken outside the B class as template<typename T> class BB;

 
Alexey Navoykov:

It's not about the variable. It doesn't see the BB class, it needs to be moved outside the B class astemplate<typename T>class BB;

The post was addressed to developers, that if they will "cheat" support out of the box.

Again, the problem concerns not being able to use a static variable declared inside a template class.
What do you suggest to do in case of typedef:

 
class A{
public:
   typedef void (*callback_A)();
   static callback_A f_ptr;

};
callback_A A::f_ptr = NULL;                  // Ok


template<typename T>
class B{
public:
   typedef T (*callback_B)();
   static callback_B f_ptr;
};
template<typename T>
callback_B B::f_ptr = NULL;                  //'callback_B' - declaration without type	

void func_A(){PRINT(__FUNCSIG__);}
int func_B(){PRINT(__FUNCSIG__); return 0;}

void OnStart(){  
   A::f_ptr = func_A;
   A::f_ptr();

   //B<int>::f_ptr = func_B;
   //B<int>::f_ptr();
}