pinecat
Pine Script Rookie
Pine Script Rookie
Posts: 1
Joined: November 1st, 2021
Contact: TradingView Profile

price value of a specific bar in history

I would need to know the price of a bar in history.
Is there a specific function?
Thanks for any hint.

Deep-Wave
Pine Script Master
Pine Script Master
Posts: 44
Joined: September 4th, 2020
Contact: TradingView Profile

Re: price value of a specific bar in history

Hi pinecat,

you can access the different prices (open, high, low, close) of historical bars with the following operators - []:
This code for example references the close of the previous bar

Code: Select all

close[1]
Maybe the free basic pine course of Matt would be a good staring point for you to learn pine.

https://courses.theartoftrading.com/cou ... ics-course


Best of luck :cool:

Return to “General Trading Discussions”