Help with array and object delete - page 2

 
Dominik Christian Egert # :
So you could use the by me typed code without any changes??


I didn't use your code, I used mine but added as a value to the function to pass the price of the close like you did. I then called the function in the main loop of the indicator passing as parameter Close[i], and now it's working correctly!thank you!

 
forextastic #:

I didn't use your code, I used mine but added as a value to the function to pass the price of the close like you did. I then called the function in the main loop of the indicator passing as parameter Close[i], and now it's working correctly!thank you!

OK. Thank you.

EDIT:
You should really try to understand my version of the code.
 
Dominik Christian Egert #:
OK. Thank you.

EDIT:
You should really try to understand my version of the code.
Sure, also because it's even more elegant than my code 😃
 
forextastic #:
Sure, also because it's even more elegant than my code 😃
And much faster, as well as consistent over large history datasets...
 
I have another problem with this indicator unfortunately. The code stays the same, and works fine, but if I use an asset where I've already inserted the indicator before, the objects are loaded immediately. But if I insert a new asset, I have to re-insert the indicator several times or do a timeframe switch to make the objects appear. What could this problem be caused by?
I thought it was due to creating the objects in the OnCalculate, but I have looked at other open source indicators which are similar and don't have this problem even though the objects are created in the OnCalculate...