To answer your question, yes, I was only "having fun" (testing) with your ticker2 file. Or if you like, I am stressing testing it. One of the calls returned a "P".
And to get back to my initial motivation, here is a "bigger" toy example,
you can think the function "f" as a likelihood function, which needs optimization.
In the big procedure, I was doing the optimization, and returns some useful information.
When I have a "complicated" function, it takes a long time to run the optimization. So I want to see if it's possible to track the values.
In the "f" procedure, if you uncomment #print(ans);
It will take a looooog time to display (print) the values. That's why the plot option is a better solution.
1 - we dont know when (and how) the "f" function is called.
2 - Yes, I am planning on calling it many times (in the same worksheet). Would that run into some danger from your code at the moment?
I will also pm you a copy of the full code for your insterest.