Download MetaTrader 5

Chart objects in visual mode

To add comments, please log in or register
Christoph Stallmann
463
Christoph Stallmann  

I came across a number of posts regarding chart objects in visual testing mode. Are there any objects that are not supported in visual mode? Most of my objects seem to work, just not OBJ_RECTANGLE_LABEL. If I do this:

bool ok = ObjectCreate(mChartId, mNameDescriptionBox, OBJ_RECTANGLE_LABEL, mWindow, 0, 0, 0, 0);
int x = ObjectFind(mChartId, mNameDescriptionBox);
int y = ObjectsTotal(mChartId, mWindow, OBJ_RECTANGLE_LABEL);

In live mode, my OBJ_RECTANGLE_LABEL shows perfectly. However in visual mode the object does not show and the result of the above code is: ok is true, x is -1 and y is 0. This means MQL creates the object (or that is what ObjectCreate returns), but immediately afterwards MQL can't find the object anymore.

Is this a possible bug or is there a plausible reason behind this?

Alain Verleyen
Moderator
33359
Alain Verleyen  
goocreations:

I came across a number of posts regarding chart objects in visual testing mode. Are there any objects that are not supported in visual mode? Most of my objects seem to work, just not OBJ_RECTANGLE_LABEL. If I do this:

In live mode, my OBJ_RECTANGLE_LABEL shows perfectly. However in visual mode the object does not show and the result of the above code is: ok is true, x is -1 and y is 0. This means MQL creates the object (or that is what ObjectCreate returns), but immediately afterwards MQL can't find the object anymore.

Is this a possible bug or is there a plausible reason behind this?

What is the value of mChartId ?
Christoph Stallmann
463
Christoph Stallmann  
Alain Verleyen:
What is the value of mChartId ?
I've tried with 0 and ChartID(), same problem.
Alain Verleyen
Moderator
33359
Alain Verleyen  
goocreations:
I've tried with 0 and ChartID(), same problem.

It should be 0. Anyway that seems a bug, is it mql4 or mql5 ?

You can report it to ServiceDesk.

Christoph Stallmann
463
Christoph Stallmann  
Alain Verleyen:

It should be 0. Anyway that seems a bug, is it mql4 or mql5 ?

You can report it to ServiceDesk.

Interesting, this worked in MQL4. So seems to be a MQL5 specific problem.


Will report it now.

To add comments, please log in or register