Errors, bugs, questions - page 1877

 
kaus_bonus:

what is the time to clear the tester agent cache in MT5?



you asked and you answered))

I get that the cache clearing time is 6 min. after this time the temp folder of the tester agent is cleared, and then the data preparation goes on again.

this is ridiculous.

 
Sergey Dzyublik:
Please tell me if there are plans to add the use of template to union, so that you can do this:
Bypass - see how this is implemented in TypeToBytes.
 
Is the error correct in this case? How can it be bypassed without removing const?
struct STRUCT
{
  const MqlTick Data;
  
  STRUCT( MqlTick &Tick ) : Data(Tick) {} // 'Data' - constructor not defined
};
 

Forum on trading, automated trading systems and trading strategy testing

Bugs, bugs, questions

fxsaber, 2017.04.10 16:23

Creating unnecessary template overloads that cause compile errors.
template <typename T>
T Func()
{
  T Res;
  
  return(Res);
}

template <typename T>
void Func( T& Value )
{
  T Res = (MqlTick)Value;
}

void OnStart()
{
  Func<string>(); // без этой строки компилируется
  
  MqlTick Tick;
  
  Func(Tick);
}

The compiler is trying to create a

void Func( string& );
1595 - never fixed.
 
Adviser
input int i = 0;

void OnInit() {}

Optimiser parameters 1595

Brute-optimisation took 5.5 minutes, which is incorrect, to say the least.

All logs are in the attached file. Please sign off whether or not it's reproducible.

Files:
Tester.zip  24 kb
 
fxsaber:
1595 - never fixed.


Remove the explicit Struct cast and everything works.

template <typename T>
T Func(){
  T Res;
  return(Res);
}

template <typename T>
void Func( T& Value ){
  T Res = Value;
}

void OnStart()
{
  Func<string>(); 
  
  MqlTick Tick;
  Func(Tick);
}


 
Sergey Dzyublik:


Remove the explicit Struct cast and everything works.

The developers have confirmed the error in the SD. Look carefully, the cast is not there.
 
fxsaber:
The developers have confirmed the error in the SD. Look carefully, the casting is not there.

template <typename T>
void Func( T& Value )
{
  T Res = (MqlTick) Value;
}
What then is this operation called?
 
Sergey Dzyublik:


Remove the explicit Struct cast and everything works.

Two questions.

1. what does this code log?

2. how does cast relate to the bug of selecting the correct function overload?

 
On MT5 1595 32bit works all to perfection (Win7 64bit):


template <typename T>
T Func(){
  T Res;
  Print (__FUNCTION__);
  return(Res);
}

template <typename T>
void Func( T& Value ){
  Print (__FUNCTION__);
  T Res = Value;
}

void OnStart()
{
  Func<string>(); 
  
  MqlTick Tick;
  Func(Tick);
}

Result:
2017.04.26 14:51:14.834 WebTest (EURUSD,H4) Func<string>
2017.04.26 14:51:14.836 WebTest (EURUSD,H4) Func<MqlTick>


No bug with function selection, how can it relate to the fact that there is none))