Reading text from chart - is this possible?

To add comments, please log in or register
Peter
1029
Peter  

Hi,

Is it possible to create an indicator that can read / scrape text from a dashboard indicator on a chart?
Reason I'm asking is because I have a multi timeframe dashboard and I would like to export the numbers to Excel...  

Keith Watford
Moderator
16952
Keith Watford  
Peter:

Hi,

Is it possible to create an indicator that can read / scrape text from a dashboard indicator on a chart?
Reason I'm asking is because I have a multi timeframe dashboard and I would like to export the numbers to Excel...  

If you know the name of the object - yes

Peter
1029
Peter  
Keith Watford:

If you know the name of the object - yes

I cannot select and right click on the object to see the name of object / text field...
It's a indicator purchased from the market.
No hope to be able to still read text values?

Keith Watford
Moderator
16952
Keith Watford  
Peter:

I cannot select and right click on the object to see the name of object / text field...
It's a indicator purchased from the market.
No hope to be able to still read text values?

You can open the Objects list (Ctrl + B)

If you can't see the object then click List All as it may be hidden.

Then you can determine whether it is a constant name or if it is possible for you to work out what the name may be (It may have the bar time in the name).

Peter
1029
Peter  
Keith Watford:

You can open the Objects list (Ctrl + B)

If you can't see the object then click List All as it may be hidden.

Then you can determine whether it is a constant name or if it is possible for you to work out what the name may be (It may have the bar time in the name).

Yes it was hidden under Object List... The object is a Button and the value I need to extract is under Description.
So might be possible?

Abir Pathak
164
Abir Pathak  
Peter:

Yes it was hidden under Object List... The object is a Button and the value I need to extract is under Description.
So might be possible?

Yes, now that you know the object's name, you can get it using ObjectGetString:

string description = ObjectGetString(0, obj_name, OBJPROP_TEXT);

If your indicator is creating another Chart Window use that value instead of 0 (for chart_id)

Here's the usage.

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
   );

https://docs.mql4.com/objects/objectgetstring

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...
Peter
1029
Peter  
Abir Pathak:

Yes, now that you know the object's name, you can get it using ObjectGetString:

If your indicator is creating another Chart Window use that value instead of 0 (for chart_id)

Here's the usage.

https://docs.mql4.com/objects/objectgetstring

Thank you Abir!

To add comments, please log in or register