Errors, bugs, questions - page 2656

 
Andrey Khatimlianskii:

Give details for reproduction. Maybe someone will be interested. There's no chance of that at all.

Code, tool, test parameters.

I have already mentioned the tool 2 times above, as shown in the picture. Any code on the MOEX stock section gives this result. Any settings, too, but equity is only displayed correctly when the calculation method is changed.
 
Andrey Khatimlianskii:

Give details for reproduction. Maybe someone will be interested. There's no chance of that at all.

Code, tool, test parameters.

Please



 

The ability to change the regular mouse pointer programmatically without a dll is very much missing.

Or just the ability to disable the rendering of the regular mouse.

 

The help for EventChartCustom () says:

sparam

[in] Event parameter of string type, passed to OnChartEvent function. If the string is longer than 63 characters, the string is truncated.

However, a 96-character long string is successfully passed, has something changed?

Here, I encrypt the string and pass it in the event, and successfully decrypt it, the string is not truncated as stated in the help and that's fine (first string encrypted followed by decrypted):

2020.02.26 14:36:10.949 iSpy (EURUSD,H1) 38CFD250C299F2420D5AFB1D070196F2F9246A164C2B1905C3921E466D6124306D836A2A09D4A06DD4B02FBDD1DE6857

2020.02.26 14:36:10.949 iSpy (EURUSD,H1) EURUSD:1.08753:1.0875:0.0:1582716971862:0.0

2020.02.26 14:36:16.391 iSpy (EURUSD,H1) 2588EC84729FA3BFE07B09BCB13832AF026A4F9DEA5634477EFF2C1FCAC355A35A67EDC5D5A8621570D3EBF80A7A942A

2020.02.26 14:36:16.391 iSpy (EURUSD,H1) EURUSD:1.08752:1.08749:0.0:1582716977068:0.0


How long is the string that can be transferred in the event without getting truncated in reality?


 
Andrey Dik:

The help for EventChartCustom () says:

sparam

[in] Event parameter of string type, passed to OnChartEvent function. If the string is longer than 63 characters, the string is truncated.

However, a string with length 96 characters is passed successfully, has something changed?

128 bytes. This is 127 uchar-characters, or 63 ushort-characters.

 

How to implement such a thing in MQL:

#include <Controls\Button.mqh>

  class Collection
  {
    protected:
      int size;

    public:
      Collection(CWnd &refs[]) { size = ArraySize(refs); }
  };


void OnStart()
{
  CButton buttons[];
  CWnd wnd[];
  Collection data1(wnd);     // ok
  Collection data2(buttons); // error
  // 'buttons' - parameter conversion not allowed
  // 'buttons' - variable of the same type expected
}
?
 
fxsaber :

128 bytes. This is 127 uchar characters, or 63 ushort characters.

This is actually 160 bytes.


Files:
 
Stanislav Korotky:

How to implement such a thing in MQL:

?
Inherit CButtons from CWnd
Or are they objects of standard library classes?
If each of them is inherited from a CObject, then:
Collection(CObject &refs[]) { size = ArraySize(refs); }
 

Dear developers, is it possible to change the UTM tags?


Or can you put the tags in order ?

utm_campaign=mt4terminal

utm_source=properties.indicator

utm_medium=indicatorName

utm_term=indicatorVersion

utm_content=Year


Now the current UTM tags are not informative...

Finteza panel: website analytics and advertising management
Finteza panel: website analytics and advertising management
  • panel.finteza.com
Real-time unsampled analytical data, traffic attribution and quality evaluation, creation of conversion funnels and targeted advertising in apps and websites
 
Artyom Trishkin:
Inherit CButtons from CWnd
Or are they standard library class objects?
If each of them is inherited from CObject, then:

That's the thing, the class tree has a common node CWnd (CObject is further away, generally at the root).

CButton -> CWndObj -> CWnd -> CObject.

If you change parameter in method to CObject, you get 2 times more errors:

'wnd' - parameter conversion not allowed
'wnd' - variable of the same type expected
'buttons' - parameter conversion not allowed
'buttons' - variable of the same type expected

A similar class hierarchy works for the non-array case. Here is the compiled code:

#include <Controls\Button.mqh>

  class Collection
  {
    protected:
      int size;

    public:
      Collection(CWnd &object) { size = 1; }
  };


void OnStart()
{
  CButton button1;
  CWnd wnd1;
  Collection data1(wnd1);     // ok
  Collection data2(button1);  // ok
}

The question is how to make it work for an array as well?

I know a template helps, but I just want to avoid it.

IMHO, it should work without templates by right of inheritance.

I checked it as in C++.

class CWnd
{
  public:
    int x;
    CWnd(int _x = 0): x(_x){}
};
class CButton: public CWnd
{
  public:
    CButton(): CWnd(10) {}
};

class Collection
{
  public:
    Collection(CWnd (&ptrs)[1]) { cout << ptrs[0].x; }
};


int main()
{
  CButton buttons[1];
  CWnd wnd[1];
  Collection data1(wnd);
  Collection data2((CWnd (&)[1]) buttons);
  return 0;
}

It works. But MQL does not digest it both with and without the index.

Reason: