MT5/mql5 reported and confirmed bugs. - page 7

 
Alain Verleyen #:

It's not obvious to me why 3FF0164840E1719F is the most accurate representation of "1.00544", why not 3FF0164840E171A0 ?

Is this defined in the standard ?

You can check it directly without inspection of hex

Print( NormalizeDouble(1.00544, 5) == 1.00544 );  // false
 

Build 3210 but probably not new.

Forum on trading, automated trading systems and testing trading strategies

Namespace variable bug ?

ILoveBouldering, 2022.02.14 20:29

Why only classes and functions are allowed in namespaces unlike variables ?

namespace A {
 int x;
}
namespace B {
 int x;
}
Fixed. Not sure from which build 3661 maybe (?).
 

Bugs in Generic/Queue

Forum on trading, automated trading systems and testing trading strategies

[SUSPECTED BUG] CQueue container class

Loris De Marchi, 2022.02.14 13:00

Hi everyone!

I suspect there is a bug in CQueue::Contains(T item) and CQueue::Remove(T item) methods, at least.

The queue is managed with the classic head-tail circular system, so this code should be incorrect:

//+------------------------------------------------------------------+
//| Removes all values from the CQueue<T>.                           |
//+------------------------------------------------------------------+
template<typename T>
bool CQueue::Contains(T item)
  {
   int count=m_size;
//--- try to find item in array
   while(count-->0)
     {
      //--- use default equality function
      if(::Equals(m_array[count],item))
         return(true);
     }
   return(false);
  }

Also the wrong method description at the top makes me think that there could be made some mistakes when this class was written down..


The Remove method clearly fails when running this simple code for example:

   CQueue<ulong> foo;
   foo.Enqueue(1);
   foo.Remove(1);
   foo.Enqueue(2);
   printf(foo.Contains(2));

It prints "false", when the element is clearly in the queue...


Let me know if this class has been fixed or if I should use one of mine.

Thanks!

Forum on trading, automated trading systems and testing trading strategies

[SUSPECTED BUG] CQueue container class

Loris De Marchi, 2022.02.15 12:09

Hi Alain!

Thank you for answering me.

To clarify the issue, let's start from an example.

Create a queue and add an element.

Then call TrimExcess(), that calls SetCapacity().

Suddently, due to that issue, the tail will be equal to the head.

If you add another element it will override the first one then!

I think this happens because the last line of the SetCapacity() method assumes that the two arrays have the same capacity, that is not true:

   m_tail=(m_size == capacity) ? 0 : m_size;

Have a nice day,

Loris



 

Forum on trading, automated trading systems and testing trading strategies

Errors, bugs, questions

Alain Verleyen , 2022.02.17 16:54

Could this be improved? MetaEditor 3211. Working with it is extremely impractical.


It was accepted and included. Don't know from which build.
 

Forum on trading, automated trading systems and testing trading strategies

Errors, bugs, questions

Alain Verleyen , 2022.02.21 16:19

Using Unicode characters in static variable names does not work in the debugger. But it works well for instance variables. Can this be fixed?

Thanks.


 
Alain Verleyen #:

Thank you for report. Fixed.

 

MT5 Build 3211 - probably previous versions as well

CAppDialog with CComboBox and a UHD monitor

If the display settings are set to anything above 100% then the drop down contents of the CComboBox do not scale and overlap each other. It gets worse the higher the % so 200% is worse than 150%.

The size of the control has already been scaled using  TERMINAL_SCREEN_DPI and displays correctly, it is just the drop down elements when making a selection. See attached picture

I would be grateful if you could check this out. 

best regards

 
Alain Verleyen #:

I found that variables containing an underscore at the beginning of their names cannot be displayed in the debugger watch window.


int _index = NULL;      // Cannot be displayed
int index = NULL;       // Shows as normal


Also, although I am not sure if this is an error, when using variables from a namespace and specifying the namespace in the debugger window will also not display.

Could this be taken care of, please?

Current release build 3211
 
Dominik Christian Egert #:

I found that variables containing an underscore at the beginning of their names cannot be displayed in the debugger watch window.

Not reproducible.


Also, although I am not sure if this is an error, when using variables from a namespace and specifying the namespace in the debugger window will also not display.

Could this be taken care of, please?

Please provide code and procedure to reproduce this namespace issue.
 
Alain Verleyen #:
I will try.

Thank you. 

In fact, I found any variable with an underscore in its name will not display.