Thanks Jcl!

One problem though I have with this is that when I run this in Trademode under FRISTRUN it will not give me the current bar and timestamp but the first Lookback bar.

Is there any way to just get the current timestamp in that format without any bar offset required?

And a related question: is there a flag similar to FIRSTRUN that is triggered on the first bar after the Lookback period?