This seems impossible to do... My ea is plotting an arrow (or 4 arrows) on each bar, which creates lots of data in long backtests. I was trying to delete all red arrows older than 100 bars, using simply For each object (Z-A, skip 100) -> delete. I named the objects as numbers - object on first bar is named 1, then 2 and so on.
The ea doesn't delete them in correct order oldest to newest, but randomly! Is it even possible to name them as numbers?
Any ideas to get rid of the old objects??
Deleting old objects
-
This seems impossible to do... My ea is plotting an arrow (or 4 arrows) on each bar, which creates lots of data in long backtests. I was trying to delete all red arrows older than 100 bars, using simply For each object (Z-A, skip 100) -> delete. I named the objects as numbers - object on first bar is named 1, then 2 and so on.
The ea doesn't delete them in correct order oldest to newest, but randomly! Is it even possible to name them as numbers?
Any ideas to get rid of the old objects?? -
Figured this out already. Made another variable oldname, which is latest name minus the wanted period, then For each object (name prefix is like Oldname) -> delete. Fxdreema is awesome.
-
You are actually right. The way you were trying to do that is the right way, but something is wrong. This is what I tried - https://fxdreema.com/shared/gHcXIiN5c - and everything is fine in the first few candles, but it fails after "myobj9". I need to investigate
-
As I expected, if you have objects with names obj1, obj2... obj8, obj9, obj10, obj11 and they are sorted by Z-A, their order is like this: obj9, obj8... obj2, obj11, obj10, obj1
The small problem is that this order is native, it comes with ObjectsTotal() itself -
Oh, thanks for the insight.
Im dumping the many objects though, realized its easier to make candle id a variable, loop x period of candles and formula the calculations necessary. Goal is to measure distance to trend line on x previous bars.
I have been using dreema for over 2 years without playing around objects or loops, they seem to open quite endless possibilities