Errors, bugs, questions - page 2767

 
Artyom Trishkin:

Judging by the behaviour you have described, this is a different EA with a completely different working algorithm.

We all figured it out, maybe it's a terminal bug or maybe it was designed by the developers, but the thing is that when you run a test on the history of any set, at the end of the test we get a chart, but all the history for this period is automatically overlaid on it from the real history.

I compared the results, then I went to the log and compared the prices of opening positions from the tester and from a real trade, they almost all coincide, there is a slight difference.

But the fact remains that real trades are superimposed on this chart after testing is completed.

To avoid their superposition I did the following

just right clicked in the journal and disabled auto-refresh, now all tests show only trades that have been tested in the tester in this chart, real trades have not been applied to it.

I asked people in the group to run their trading robots for a period when they had something traded on this symbol, using robots, whatever, they all have confirmed this fact that in addition to transactions in the tester, the chart is overlaid with real trades that were traded in the past.


If you have trades in any instrument, run any robot for this period and you will see that these trades will be applied to the chart and if autotrading is disabled, the real ones will not be applied.

I think it's worth telling the developers, I like this bug, now I can test the robot for a week and compare the difference in trades on the chart, ideally it should be different by a couple of ticks

 
Konstantin Seredkin:

In addition to the tester's trades, real trades that were traded in the past are superimposed on the chart.

This behaviour is invisible to those who use custom symbols. But for real symbols it looks quite inconvenient.

 

In the debugger, the value ofGetLastError(); cannot be retrieved?

only through a variable or predefined _LastError ?

Files:
 
awsomdino:

In the debugger, the value of GetLastError(); cannot be retrieved?

Only through a variable or predefined _LastError ?

Yes. This is where _Value comes in handy.

 
fxsaber:

Yes. This is what _Value is good for.

Maybe the developers will add the ability to look in the debugger from theGetLastError() function;

otherwise these convenient and simple 2 lines are useless

   if(GetLastError()>0)
      DebugBreak();
 
awsomdino:

maybe developers will add possibility to look in debugger fromGetLastError() function;

otherwise these convenient and simple 2 lines are useless.

Do not use just this function.

 

In order to minimize the number of entries from the previous "review" fixes, previously fixed defects were not transferred:

Defects in template function/class operation:
(not fixed by MT5(build 2474)) *** Compile Error, bug on attempting to access internal class for template function parameter.
(not fixed by MT5(build 2474)) ** Compile Error, bug on the return value of a template function when the return value is an internal class inside a template class whose parameter type is specified by the argument type of the template function.
(not fixed by MT5(build 2474)) ** Compile Error, namespace and scope bug in template constructor when calling base class when same class name is used in inheritance and internal class.
(not fixed by MT5(build 2474)) * Compile Error, bug on template function call with explicit argument types when called from overloaded non-template function.
(not fixed
by MT5(build 2474)) Compile Error, bug on internal class definition - no reference to global namespace when specifying a base class.
(not fixed by MT5(build 2474)) * Compile Error, when calling assignment statement via explicit base class indication. The problem occurs for a template class where the template parameter acts as a base class.
(fixed
by MT5(build 2474)) Compile Error, when using default access modifier for inheritance in a template class where the template parameter is a base class.
(fixed by MT5(build 2474)) * (new) Compile Error, compile error when inheriting from template class from namespace.
(fixed by MT5(build 2474)) ** (new) Compile Error, default operator= is not accessed from pointer object.
(not fixed
by MT5(build 2474)) *** (new)Compile Error, compile error for forward declaration of template class method .
(
not fixed by MT5(build 2474)) ** (new)Compile Error when class contains a pointer to a wrapper class which uses the class as a field.


Defects related to mismatching priorities of overloaded function calls in MQL vs C++:
(not fixed in MT5(build 2474)) ** Compile Error when the first of overloaded overloaded template functions uses fully specialized template base class and the second uses unspecialized template base class.
(not fixed by MT5(build 2474)) ** Compile Error, a compile error occurs when generating the code of a template function despite the fact that there is an overloaded template function with a suitable signature for the passed parameters.
(not fixed by MT5(build 2474)) * Compile Error, "ambiguous call to overloaded function" when overloaded template functions with different number of template parameters are called.

( not fixed by MT5(build 2474)) *** Compile Error, error in calling overloaded template functions.
( not fixed by MT5(build 2474)) ** Compile Error, implicit type conversation is used when calling a function for an argument with data type color despite there being a matching signature overloaded template function with data type color.
( not fixed by MT5(build 2474)) * Compile Error, despite the explicit specialization when overloaded template function is called, the template function is called by default anyway, that leads to stack overflow...
( not fixed by MT5(build 2474)) * Compile Error, compilation error when calling a function via its pointer when an array of function pointers is used.
( fixed by MT5(build 2474)) * (new) Compile Error, problems with call priority of functions overloaded in namespace.

MetaEditor related bugs:
(not fixed by ME5(build 2474)) *** Debugger, a breakpoint instatic structuremethod causes MT terminal to hang.
(not fixed in ME5(build 2474)) ** Compilation, compilation error description does not fit into 256-character limit and is cut off, thus making it impossible to understand which data type the error is generated for because the required part is cut off.
(fixed in ME5(build 2474)) ** Debugger, StepInto (F11) and set breakpoints do not work.
(fixed in ME5(build 2474)) * Debuger, after a breakpoint is triggered instead of continuing code execution by pressing (F5), the same breakpoint is actually triggered again without executing any code.
(not fixed in ME5(build 2474)) * Compilation, incorrect function template parameter signature in Error Description and Parameter info.
(not fixed in ME5(build 2474)) * MetaEditor, the Replace (Strl + H) functionality does not work for enabled "In selection" along with "Backward direction" when the necessary part of the application is selected, but not the whole code.
(not fixed by ME5(build 2474)) * (new) MetaEditor, triggering a breakpoint misleads the user into believing that an input condition has been met, when in reality it may not be so at all.


Defects related to slow function execution, code optimizer:
(fixed by MT5(build 2474)) **(up) Runtime, large overhead when adding one element at a time into an array using ArrayResize, despite the fact that memory for them has been reserved in advance, for example, structures are up to 7 times slower.


Suggestions:
- add to ME search/replacement by current Project, while during refactoring going through each of files and search for occurrence is not very good.
link- in ME at compilation to fill in empty columns File, Line, Column with appropriate information about the source file, from which was made include.
link- about introduction of intellisense support for namespace functionality on the basis of intellisense work for static methods in classes.
link- about providing possibility to pass literals and temporary variables as const ref arguments of a function.
link- whenmoving projectfiles in "Project" tab, for moved files which are opened and are in ME tabs, to automatically update their location path.
link- about necessity to introduce typedef declaration functionality in MQL.
link- about providing possibility to force generation of default copy constructors and assignment operators.

 
Sergey Dzyublik :

In order to minimise the number of entries from the last "review" of corrections, previously corrected defects have not been carried forward:
.
..

Is this on your list? If not, could you please add this.

Forum on trading, automated trading systems and strategy testing

Wrong MQL syntax?

Dan Marinescu, 2020.05.27 22:47

I have defined a universal interface and I want to use it in another class. I can't figure out what's wrong with this code:

 #property  strict

template < typename T> interface IGenericHandler {
     bool Handle(T &item);
};

#define  DOES_NOT_WORK

class GenericHandler {
     public :
#ifdef  DOES_NOT_WORK   
         template < typename T> bool Handle(T &val, IGenericHandler<T> *handler);
#else   
         template < typename T> bool Handle(T &val, IGenericHandler<T> *handler) { return false ; }
#endif        
 };

#ifdef  DOES_NOT_WORK
template < typename T> bool GenericHandler::Handle(T &val, IGenericHandler<T> *handler) { return false ; }
#endif 

If DOES_NOT_WORK is not defined, everything works. But when DOES_NOT_WORK is defined, the compiler says:

'Handle' - member function already defined with different parameters

Why?


 
Alain Verleyen:

Is this on your list? If not, could you add this please.

Thanks for the addition, yes there is a description of this problem in the list:
(not fixed by MT5(build 2474)) *** (new)CompileError,compilation error for forward declaration of template method of class.

 
Sergey Dzyublik :

Thanks for the addition, yes there is a description of this problem in the list:
( not fixed by MT5(build 2474)) *** (new) Compile Error , about compilation error for forward declaration of template class method .

Great, thanks.
Reason: