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);
.
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
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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 ?