'Plot Vetical Line on, Time of Market Close in the Future

I want to draw a simple vertical line for intraday on the last bar before the market closes

I don't know what I am doing wrong and the correct solution.

//@version=5
indicator('time_market_open_close', overlay=true, precision=1)

s2=request.security(syminfo.tickerid, "D", close[1], barmerge.gaps_on, barmerge.lookahead_on)
market_close_3 = time( (s2) )

market_close_time = market_close_3 

line.new(market_close_time, open, market_close_time, close, xloc=xloc.bar_time, style=line.style_dotted,extend=extend.both, width = 3 , color = color.green)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source