HI, I need your help.
I draw the horizontal Line on the chart by manual.
And I want the EA to read the value (price)
But when I draw it by manual, object name has some numbers. --> 38987
What is this number?
TO read the price of the line, I want to use
But can I use wildcart of the object?
Instead of below?
When you draw the line, open the properties box and rename it.
You don't use
double dn=ObjectGetValueByShift("Horizontal Line 38987", 0);
for a horizontal line as it only has 1 price.
Use ObjectGetDouble()
Thanks, Keith
is there any ways to pick up the price of the Horizontal line without rename it?
Like.... Find the pre-fix of Horizontal ****, then use ObjectGetDouble to read the price.
Thanks, Keith
is there any ways to pick up the price of the Horizontal line without rename it?
Like.... Find the pre-fix of Horizontal ****, then use ObjectGetDouble to read the price.
Loop through all objects on the chart and compare the name with pattern (using StringFind or StringSubstr).
See example from the ObjectsTotal help page
- docs.mql4.com
Thanks, Keith
is there any ways to pick up the price of the Horizontal line without rename it?
Like.... Find the pre-fix of Horizontal ****, then use ObjectGetDouble to read the price.
Only if you know for sure that there will only be 1 horizontal line on the chart at any time.
Only if you know for sure that there will only be 1 horizontal line on the chart at any time.
Loop through all objects on the chart and compare the name with pattern (using StringFind or StringSubstr).
See example from the ObjectsTotal help page
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
HI, I need your help.
I draw the horizontal Line on the chart by manual.
And I want the EA to read the value (price)
But when I draw it by manual, object name has some numbers. --> 38987
What is this number?
TO read the price of the line, I want to use
But can I use wildcart of the object?
Instead of below?