ObjectGetValueByShift does not work with horizontal lines?

Back to topics list To post a new topic, please log in or register
avatar
21
maxxmax 2015.11.20 20:27
 

I am trying to get the value (price for last bar) of a horizontal line (added manually to a graph) by the function ObjectGetValueByShift( after renaming it from object properties as "MyLine)"  ,  but the value returned is always zero.

The same function works correctly with a trendline added manually to the graph and renamed with same name "MyLine").

The code I am using for the EA  is  :

double price=ObjectGetValueByShift("MyLine", 0);

Any explanation for this weird behaviour ?

avatar
Moderator
3407
GumRai 2015.11.20 21:28 #
 

Why would you need to get the value by shift?

It is a horizontal line, there is only 1 price value 

  double price=ObjectGetDouble(0,"MyLine",OBJPROP_PRICE);

 .

avatar
21
maxxmax 2015.11.20 21:58 #
 
GumRai:

Why would you need to get the value by shift?

It is a horizontal line, there is only 1 price value 

 .

I see, great !   With your code the call now works smoothly.

Thank you a lot GumRai


Regards

Max


Back to topics list  

To add comments, please log in or register