OHLC values of First Trade Bar[At the time of Commencement]

52 views Asked by At

Can anyone suggest me, how to obtain First 15min time frame bar OHLC values i.e at the time of commencement.

Eg CIPLA stock was commenced from month Jan 1999 If I'm interested in knowing first candle OHLC values in the month of Jan 1999, is there any way to obtain the values.

I have my own reasons for seeking the help, since I am just modifying heikin ashi candles

1

There are 1 answers

0
Starr Lucky On

//@version=5
indicator("My script")

firstPrice()=>
    var o = ta.valuewhen(bar_index == 0, open, 0)
    var h = ta.valuewhen(bar_index == 0, open, 0)
    var l = ta.valuewhen(bar_index == 0, open, 0)
    var c = ta.valuewhen(bar_index == 0, open, 0)
    [o, h, l, c]
        
    
[o, h, l, c] = request.security("NASDAQ:AAPL", "1D", firstPrice())

plot(o)
plot(h)
plot(l)
plot(c)