Here's what I'm trying to do. I want to create an indicator in pine script where the user inputs the date/time they sold a short call/put and the strike for which they sold. Then I want to create a plot line just for that specific date at the start time specified by the user to the close of day for the strike given. I then want to draw a trendline from the start time to the close of day terminating at the strike plot line created. It would look something like the image below. This is as far as I've gotten with my script but I can't seem to limit the strike to a specific date. I haven't even begun the trendline yet:
//@version=4
study("Entry to Strike Trendline", overlay=true)
entry = input(defval = timestamp("8/31/2021"), title = "Entry Date/Time", type = input.time)
strike = input(defval = 4400, title = "Short Strike", type = input.integer)
startDate = timestamp(year(entry), month(entry), dayofmonth(entry), 0, 0)
endDate = timestamp(year(entry), month(entry), dayofmonth(entry), 13, 0)
var int linePrice = na
if time >= startDate and time <= endDate
linePrice := strike
plot(linePrice)
