Anyone know how to read the value from a graphical object?

 
Hi all,

I want to be able to draw an object (eg a line) and for my code to be able to read the parameters of that line and perform operations based on those parameters. (x1, y1, x2,y2)....Is there such a functionality in mq4?

Thanks in advance
 
Yup.

Check the Object Functions for the details, but I think you want ObjectGet(), which will let you pull properties for a graphical object. For the line, you'd probably grab OBJPROP_TIME# and OBJPROP_PRICE# for the line (technically "trend"). The list of object types might be useful to for knowing what properties might be available for an object.

Good luck!
--Matt
 
See documentation https://docs.mql4.com/objects

See example 'Rotating text'

Search "object"
 
Thank you both :)
 
Marty wrote:
Thank you both :)

Hmmmmmmmmmmmm....it thinks that OBJPROP_TIME1 of a line is 1.1.1970! Oh what?
 
ObjectValueByShift and ObjectShiftByValue work well.
 
irusoh1 wrote:
ObjectValueByShift and ObjectShiftByValue work well.

What do those do? can't find them in documentation....I suspect they shift objects? That's not what I'm trying to do though.
 
Sorry

ObjectGetValueByShift and ObjectGetShiftByValue

they give trendline value at certain bar and vice versa
 
irusoh1 wrote:
Sorry

ObjectGetValueByShift and ObjectGetShiftByValue

they give trendline value at certain bar and vice versa

Wow. Awesome. And here I am, making convoluted slope calculations! Thanks!
 

Hi,

Can anyone tell me where I can find the source code for the 'Standard Deviation Channel' indicator?

Reason: