DayTrader:
I'm calling this function from the EA's deInit, But none of the objects are deleted... Any idea why ?
Found the problem: OrdersTotal() wont work as a loop argument, it has to be assigned to a variable outside the loop. Go figure !
If you are deleting objects, you need to start the loop at the top:
for(i = ObjectsTotal()-1; i>= 0; i--){
delete....
}
...Not necessarily as I found out...
This code I came up with works just fine. The funny thing is that it generates errors and no objects are deleted if ObjectsTotal()
is passed as a While-argument. Going via a variable as shown here works just fine as far as I can tell.
//---------------- DeleteInfoBackground ------------------------- void DeleteInfoBackground() { int ObjectsAll = ObjectsTotal(); int i = 0; while(i < ObjectsAll) { ObjectDelete("RecI"+i);//Background for the InfoField ObjectDelete("RecW"+i);//Background for the WarningField i++; } return (0); } //-----------------------------------------------------
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
I'm calling this function from the EA's deInit, But none of the objects are deleted... Any idea why ?