I am not sure about the appropriate variable to extract bid and ask price of a stock/commodity.
indicator("Spread - Bid Ask")
bid_price= input(title="Symbol 1", type=symbol, defval= bid_price)
ask_price = input(title="Symbol 2", type=symbol, defval=ask_price )
spread=(security(ask_price ,period, close)-security(bid_price,period, close))/security(ask_price ,period, close)
plot(spread, color=red)
What would be the exact code for this?