I need to get a price (in my case the first opening price) after a specifig date. I've got the timestamp, let's say I need the first opening price after 15.05.2019. The function is called on the last bar on the chart, so I really need to get a historic price back and not while processing every bar.
I can't find a possibility to do that within a function. It seems a quite simple task, but I am stuck for hours now...
I have tried ta.valuwehen and also a condition, but as I am on the last bar already, it will always show me the closing price of the current bar. E.g.:
var testopen = 0.0
testopen := ta.valuewhen(time > first_buy_timestamp_start, open, 0)
and
var testopen = 0.0
if time > as first_buy_timestamp_start and testopen == 0.0
testopen := close