Abraham Reinhardt
Abraham Reinhardt

Reputation: 107

How to plot highest price of higher timeframe and view it on lower timeframe charts

I'd like to see the highest price of last 5 days on 4h chart and maybe other lower timeframe charts. The function that I found in coding reference: highest(source, length) seems not taking interval as a parameter. I came from mt4 which having this feature. So how do we do this in pine script?

Upvotes: 0

Views: 696

Answers (2)

kambiz hosseinzadeh
kambiz hosseinzadeh

Reputation: 11

   //@version=5
   indicator("line1" , overlay =true)
   s = request.security("Kucoin:BTCUSDT", "W", high) // 1 Day
   t = request.security("Kucoin:BTCUSDT", "W", low ) // 1 Day
   plot(s)
   plot(t)

Upvotes: 0

Starr Lucky
Starr Lucky

Reputation: 1961

Use security function:

//@version=4
study("My Script", overlay = true )
s = security(syminfo.tickerid, "1D", highest(5))
plot(s)

Upvotes: 1

Related Questions