The function "MQL4: ObjectGetValueByShift" is for trendlines only.
Use such expression instead:
The function calculates and returns the price value for the specified bar (shift related to the current bar). The price value is calculated by the first and second coordinates using a linear equation. Applied to trendlines and similar objects. To get the detailed error information, one has to call the "MQL4: GetLastError" function.
Use such expression instead:
if (Ask >= ObjectGet("Horizontal Line 1234",OBJPROP_PRICE1)) Alert("price come close to line");

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
if (Ask >= ObjectGetValueByShift("Horizontal Line 1234",0))
alert("price come close to line")
But it doesn't work. However this method works for trendline. So what am I doing wrong. What is the object name for horizontal line?
Someone please help. Thank you
Trav