Finding an ObjectType on multiple charts without knowing object name
Use ObjectName with ChartID, it will work.
Use ObjectName with ChartID, it will work.
If you got the name you call ObjectGetInteger to get the Type.
If you got the name you call ObjectGetInteger to get the Type.
OK, thanks. The following works:
if ((ObjectGetInteger(ID,ObjectName(ID,x),OBJPROP_TYPE) == OBJ_HLINE) || (ObjectGetInteger(ID,ObjectName(ID,x),OBJPROP_TYPE) == OBJ_TREND)) {
The MQL4 Reference help file needs to be updated to show that you can use ID with ObjectName.
OK, thanks. The following works:
The MQL4 Reference help file needs to be updated to show that you can use ID with ObjectName.
thanks for sharing
hope that service desk report the same to update help file/s for MQL4
In MT4, is it possible to read through all open charts and count all the HLINE and TREND objects of a specific color? I have the following code and know that the statements after the "for" loop will not work because the ObjectName function does not have a ChartID parameter. I tried looking for something else that might work (e.g. ObjectGetString) but haven't found anything.