Hey, Please, i coded and indicator and everything is okey and fine but it creates multiple objects and in the code i try to loop through them and it works fine. But if i load with other indicatos that themselves also creates multiple objects, the number of objects increase on the chart and when trying to modify them with by looping through them with the standard ObjectSetInteger() etc functions which are asynchronous, the objects then take time to refresh despite using ChartRedraw so for this issue where we have a large number of objects, what would be the best approach to modify them? Been looking for this on the forum but didn't found anything. Maybe I am wording it wrongly. Example of code of me looping throught the objects to modify them.
- Errors, bugs, questions
- MT4 Multiple Trades EA
- Questions from Beginners MQL5 MT5 MetaTrader 5
Bryan Djoufack Nguessong:
Hey, Please, i coded and indicator and everything is okey and fine but it creates multiple objects and in the code i try to loop through them and it works fine. But if i load with other indicatos that themselves also creates multiple objects, the number of objects increase on the chart and when trying to modify them with by looping through them with the standard ObjectSetInteger() etc functions which are asynchronous, the objects then take time to refresh despite using ChartRedraw so for this issue where we have a large number of objects, what would be the best approach to modify them? Been looking for this on the forum but didn't found anything. Maybe I am wording it wrongly. Example of code of me looping throught the objects to modify them.
Hey, Please, i coded and indicator and everything is okey and fine but it creates multiple objects and in the code i try to loop through them and it works fine. But if i load with other indicatos that themselves also creates multiple objects, the number of objects increase on the chart and when trying to modify them with by looping through them with the standard ObjectSetInteger() etc functions which are asynchronous, the objects then take time to refresh despite using ChartRedraw so for this issue where we have a large number of objects, what would be the best approach to modify them? Been looking for this on the forum but didn't found anything. Maybe I am wording it wrongly. Example of code of me looping throught the objects to modify them.
En effet, puisque tu as plusieurs objets, il est déconseillé d'appeler la fonction "ObjetsTotal()" dans la boucle.
Deuxièmement, tu sembles répéter inutilement certaines opérations et fonctions.
Bref, essaie avec cette notation, tout simplement :
int Total = ObjectsTotal(); string symb = Symbol(), nameObj = "", strBuy = prefix + " BUYZONE", strSell = prefix+" SELLZONE"; for(int = 0; int < Total; i++) { nameObj = ObjectName(0, i); if (StringFind(nameObj, symb) != -1 && ((StringFind(nameObj, strBuy) != -1 || StringFind(nameObj, strSell) != -1))) // Constatez que j'ai ajouter une paire de parenthèses pour cette deuxième partie de la condition { ObjectSetInteger(0, nameObj, OBJPROP_TIMEFRAMES, OBJ_ALL_PERIODS); } } ChartRedraw(); // Appelez cette fonction une seule fois ici à la fin de toute la boucle, et non dans la boucle et à chaque itération, non.

Vous manquez des opportunités de trading :
- Applications de trading gratuites
- Plus de 8 000 signaux à copier
- Actualités économiques pour explorer les marchés financiers
Inscription
Se connecter
Vous acceptez la politique du site Web et les conditions d'utilisation
Si vous n'avez pas de compte, veuillez vous inscrire