Here you have the list of nearly all functions for MT5 with a short description to enable a search with some sot of keywords: https://www.mql5.com/de/docs/function_indices
Look for ObjectsTotal and loop through all of them ...
- www.mql5.com
Here you have the list of nearly all functions for MT5 with a short description to enable a search with some sot of keywords: https://www.mql5.com/de/docs/function_indices
Look for ObjectsTotal and loop through all of them ...
thanks
I know ObjectsTotal() but how I can loop through objects ?
when I create a loop like "for (i = 0 ; i < ObjectsTotal(); i++) " , how can I refer to an object by i ??
Use the functions on the left side of ObjectsTotal() like ObjectGetDouble().
For the loop don't despair start to search: https://www.mql5.com/en/search#!keyword=ObjectsTotal&module=mql5_module_codebase
- www.mql5.com
thanks
I know ObjectsTotal() but how I can loop through objects ?
when I create a loop like "for (i = 0 ; i < ObjectsTotal(); i++) " , how can I refer to an object by i ??
int totalObjects = ObjectsTotal(0, -1, -1); for(int i = 0; i < totalObjects; i++) { string objectName = ObjectName(0, i, -1, -1); if(ObjectGetInteger(0, objectName, OBJPROP_TYPE) == OBJ_ARROW) { if(ObjectGetInteger(ChartID(), ObjectName(ChartID(), i, -1, -1), OBJPROP_COLOR, 0) == clrRed) { datetime arrowTime = (datetime) ObjectGetInteger(0, objectName, OBJPROP_TIME); int Bar = iBarShift(_Symbol, _Period, arrowTime); } } }
this code snippet might help. it is used to find the bar number where an object is plotted. Maybe that is what you mean by "i".
this code snippet might help. it is used to find the bar number where an object is plotted. Maybe that is what you mean by "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
I have some different objects ( like H_lines and arrows and ....) on my chart and I wanna get all of their prices and set them in an array.
help me plz
thanks