MQL programs don't get the correct name of a newly created object when OnChartEvent is triggered after the object name is changed via properties dialog shown after creation.
Steps to reproduce the issue:
Enable "Show object properties after creation" in Tools>Options>Charts
Create a new object
Change the name of the newly created object via properties dialog
Click OK.
Expectation:
CHARTEVENT_OBJECT_CHANGE should be triggered along with CHARTEVENT_OBJECT_CREATE and CHARTEVENT_OBJECT_DRAG (If dragged).
sparam should be set to changed object name when CHARTEVENT_OBJECT_CHANGE is triggered.
What happens:
CHARTEVENT_OBJECT_CREATE is triggered with MT generated object name.
CHARTEVENT_OBJECT_DRAG is triggered with MT generated object name and not the changed object name.
CHARTEVENT_OBJECT_CHANGE is not triggered.
** If programs tries to get properties of newly created object by passing sparam as object name, ObjectGetInteger/ObjectGetDouble/ObjectGetString functions return 4203 error and ObjectFind function returns 4202 error.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Issue:
Steps to reproduce the issue:
Expectation:
What happens:
- CHARTEVENT_OBJECT_CREATE is triggered with MT generated object name.
- CHARTEVENT_OBJECT_DRAG is triggered with MT generated object name and not the changed object name.
- CHARTEVENT_OBJECT_CHANGE is not triggered.
** If programs tries to get properties of newly created object by passing sparam as object name, ObjectGetInteger/ObjectGetDouble/ObjectGetString functions return 4203 error and ObjectFind function returns 4202 error.Here's the code to test:
Here's the result: