Lab Devices
Lab Devices

Reputation: 43

Can i get data of specific old candles in Pinescript?

I wanna to get data of old candles such as high, low , close , open

Can i get the data of candle 1 and 2 ?

click to see the image

Note : the code in this link that i use to select those candles

How to check if the candle is the largest one in Pine-Script?

Upvotes: 0

Views: 736

Answers (1)

alexgrover
alexgrover

Reputation: 1043

Use the valuewhen function, if you want the high price you can use:

valuewhen(rising(r,50),high,0)

for "candle 2" in your image, for candle 1 use

valuewhen(rising(r,50),high,2)

Upvotes: 1

Related Questions