80613536:
Hi guys, on my costom indicator I draw a lot of hline bye this line code:
if(!ObjectCreate(ChartID(),Obj_Name,OBJ_TREND,0,time[i],TG,time[i-1],TG)){
Qnt_Symb=FileWrite(FileOUT,"Errore creazione oggetto getlasterror ", GetLastError());
}
ObjectSetInteger(ChartID(),Obj_Name,OBJPROP_COLOR,Colore);
ObjectSetInteger(ChartID(),Obj_Name,OBJPROP_STYLE,Stile);
All these line are hline starting on time[i].
Now I want delete all line < price[x] and > price[y]
Can someone of you help my with a good idea?
Tank for every help
Fabio
OBJ_TREND is not hline
if they are horizontal trend lines then just create a loop, go through the objects, test the price criteria and delete
RemoveObjects(price[x], price[y]); void RemoveObjects(double minPrice, double maxPrice) { for(int i = ObjectsTotal(); i >= 0; i--) { string name = ObjectName(i); double price = ObjectGetDouble(0, name, OBJPROP_PRICE); if(price < minPrice || price > maxPrice) { ObjectDelete(name); } } }
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Hi guys, on my costom indicator I draw a lot of hline bye this line code:
if(!ObjectCreate(ChartID(),Obj_Name,OBJ_TREND,0,time[i],TG,time[i-1],TG)){
Qnt_Symb=FileWrite(FileOUT,"Errore creazione oggetto getlasterror ", GetLastError());
}
ObjectSetInteger(ChartID(),Obj_Name,OBJPROP_COLOR,Colore);
ObjectSetInteger(ChartID(),Obj_Name,OBJPROP_STYLE,Stile);
All these line are hline starting on time[i].
Now I want delete all line < price[x] and > price[y]
Can someone of you help my with a good idea?
Tank for every help
Fabio