Errors, bugs, questions - page 2309

 

After updating to build 1910 the indicator buffers "bounce" in the tester in visualisation mode.

It is possible to get the indicator values correct. Below you can see that the trend lines (red) have been superimposed on the obtained values of the ZigZag indicator (yellow) for control.


 

What could have changed in the tester that some EAs now work in visualisation mode but not in normal single run?

And how can the cause of this problem now be identified under these conditions?

 

Can you tell me where I'm stupid?

template <typename T1, typename T2>
T1 f( T2 Value )
{
  return((T1)Value);
}

double d = f<double>(0); // 'f' - wrong template parameters count
 
fxsaber:

Can you tell me where I'm stupid?

Either you specify all the parameters explicitly, or you don't.

 
TheXpert:

Either you specify all the parameters explicitly, or you don't.

It seems to be completely unambiguous in the code. T2 is int, T1 is double.

 
fxsaber:

Seems to be a complete unambiguity in the code. T2 is int, T1 is double.

yes. it doesn't matter, you still need to specify both parameters

 
TheXpert:

Yes. It doesn't matter, you still have to specify both parameters

Hadn't realised, thanks!

 

How do I achieve a default value for the input parameter of a function?

typedef void (*FUNC)();

void f1() {};

void f2( FUNC g = f1 ) {} // 'f1' - constant expected
 
fxsaber:

How do I achieve a default value for the input parameter of a function?

By overloading?
 
TheXpert:
By overloading?

It's understandable. I wasn't asking about a workaround, but about the correct syntax, so that the compiler wouldn't generate an error. I think it is possible to do this in C++ and probably in MQL5.

Reason: