- "Draw by hand" is irrevalent.
- There are no such things with a rectangle.
-
Rectangle coordinates are price and time. ObjectGetDouble/OBJPROP_PRICE
Perhaps you should read the manual.
How To Ask Questions The Smart Way. 2004
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.
Thankz i saw
i create somthing like this but i dont can find a time coordinate
int start() { for(int i = ObjectsTotal(); i >= 0; i--) { string name = ObjectName(i); if(ObjectType(name) == OBJ_RECTANGLE ) { double price1 = ObjectGetDouble(MainWINDOW, name, OBJPROP_PRICE1); double price2 = ObjectGetDouble(MainWINDOW, name, OBJPROP_PRICE2); datetime time1 = ObjectGetTimeByValue(MainWINDOW, name,price1, 0); datetime time2 = ObjectGetTimeByValue(MainWINDOW, name, OBJPROP_TIME2); color rColor = color(ObjectGetInteger(MainWINDOW, name, OBJPROP_COLOR)); Print("babbabbba "+ TimeToStr(time1)); Print("babbabbba222 "+ TimeToStr(time2)); } } return 0; }
where is the problem ???
- www.mql5.com
if(ObjectType(name) == OBJ_RECTANGLE )
Perhaps you should read the manual.
How To Ask Questions The Smart Way. 2004
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.
thankz i resolve with this code
double price1 = ObjectGetDouble(0, name, OBJPROP_PRICE1,0); double price2 = ObjectGetDouble(0, name, OBJPROP_PRICE2,0); datetime time1 = ObjectGet(name,OBJPROP_TIME1); datetime time2 = ObjectGet(name,OBJPROP_TIME2);
for(int i = ObjectsTotal(); i >= 0; i--)
You also have a mistake in the loop, it should be one of the below cases:
for(int i = ObjectsTotal()-1; i >= 0; i--) for(int i = ObjectsTotal(); i > 0; i--)
for(int i = ObjectsTotal(); i > 0; i--)
That will not work, you will still iterate with one invalid index and miss index zero.
-
for(int i = ObjectsTotal(); i > 0; i--) { string name = ObjectName(i-1);
works, as does -
for(int i = ObjectsTotal(); i > 1; ) { i--; string name = ObjectName(i);
You also have a mistake in the loop, it should be one of the below cases:
for(int i = ObjectsTotal()-1; i >= 0; i--) for(int i = ObjectsTotal(); i > 0; i--)
- 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 guys if i draw by hand a rectangle is possible by script have a coordinate in chart and dimention ??
anyone have some example thankz