Dynamic Param default value

I am seeking a way to dynamically change the default value for when I open my backtest formula’s Parameters Dialog.

I realize the Param() Documentation https://www.amibroker.com/guide/afl/param.html states that arguments must be constants, and I’m guessing this applies to ParamStr() as well.

I did try the code snippet below, but I believe that because of caching, the displayed value does not display the value returned by the function. Is there a backdoor workaround? Or is this something that not possible?

PS - It would also be helpful if pressing the “Reset” button recomputed the default values (e.g. from the DateTimeToStr function) rather than returning them from “memory”.

Thank you in advance.

Minor clarification. Pressing Reset button the first time does execute the function. Subsequent presses of the reset button do not appear to return the value from the function.

Default values are cached and won’t change until “Reset”. This is by design and can’t be changed for too many reasons to mention.