Wrote this before your last update post!
Just a few thought…
When condition is true and new data is stored in AnyVariable along with the current ArrayIndex count,
these values don’t change and are stored with the following bars where condition is false, until next bar where it is true again.
Let’s say that, the Newdata is ‘9’ and doesn’t change over several times the condition is true, (the repeated values are not represented).
9,9,9,9,9,… AnyVariable
0,1,2,3,4,… ArrayIndex
In the recovery process, the Barssince condition is looking for a change in data value, x > x[1].
But if, AnyVariable is the same value as in example, I presume there will be an error in recovery.
However, the Array index is going to be different with every valid entry, regardless if the data was the same.
So, there could be an error if the data value is the same, and maybe away around that is to, look for a change in the index value.
Or, ensuring that the non valid data value is -1 or something, so to get the change.
Maybe a simple solution is to remove the ‘Once’ from before the AnyVariable = 0, this would default it to the = 0 value every bar, until a true condition value.
You could also used the ‘0’ to test if recovered data value is valid, and has not not fell out of sequence somewhere.
0, 0,0 ,9,0,0,0,9,0,0,0,9,0,0,0,9,0,0,0,9,… AnyVariable
-1,-1,-1, 0,0,0,0,1, 1, 1, 1,2,2,2,2, 3,3,3,3,4,… ArrayIndex
Anyway. Regards