I would like to get the latest closing price in pinescript. I thought this is a simple thing to do, yet I face difficulty.
I tried close
but this returns the closing price of the bar selected by the mouse. What I want is the closing price of the last bar in the price history.
I am using pinescript v5