question about ObjectGetString on an other chart

To add comments, please log in or register
ReactoFX
184
ReactoFX  

Good morning everyone,


I want my code to read the text in a label on other charts in the same workspace. I read this document: https://docs.mql4.com/objects/objectgetstring and I used this line of code:

string   BiasTextEURAUD    = ObjectGetString("EURAUD", "Label_Bias", OBJPROP_TEXT, 0);

I expect the code to return the text in the label called Label_Bias, but on compile I get the following warning:

implicit conversion from 'string' to 'number'


As a result the code does not work.


Can anyone please tell me what I should do differently to get the code to return the text in the label?


Robert

ObjectGetString - Object Functions - MQL4 Reference
ObjectGetString - Object Functions - MQL4 Reference
  • docs.mql4.com
The function returns the value of the corresponding object property. The object property must be of the string type. There are 2 variants of the function. [in]  Modifier of the specified property. For the first variant, the default modifier value is equal to 0. Most properties do not require a modifier.  It denotes the number of the level in...
Fabio Cavalloni
3839
Fabio Cavalloni  
string  ObjectGetString(
   long    chart_id,          // chart identifier
   string  object_name,       // object name
   int     prop_id,           // property identifier
   int     prop_modifier=0    // property modifier, if required
   );

You used the chart symbol but you need to use the ChartIdentified, that is a totally different thing.

Please, read better the documentaton.

ReactoFX
184
ReactoFX  
Thanks Fabio, I understand the term Chart Identifier was not clear to me.
To add comments, please log in or register