I need the high and low of the 3 hour candle on an hourly chart starting from the week.
<code>//@version=5
indicator("test", overlay = true)
NEWWK = timeframe.change("W")
bgcolor(NEWWK ? #7f7f7caa: na)
barsSinceBeginingOfWeek = ta.barssince(NEWWK)
var plotLine = false
barnumber = ta.barssince(NEWWK)
if barsSinceBeginingOfWeek == 3
plotline := true
h = ta.valuewhen(plotline, high, 0)
plot(h, "high", color.red,1)
plot(barsSinceBeginingOfWeek, "Bn", color.white, 2)
</code>
<code>//@version=5
indicator("test", overlay = true)
NEWWK = timeframe.change("W")
bgcolor(NEWWK ? #7f7f7caa: na)
barsSinceBeginingOfWeek = ta.barssince(NEWWK)
var plotLine = false
barnumber = ta.barssince(NEWWK)
if barsSinceBeginingOfWeek == 3
plotline := true
h = ta.valuewhen(plotline, high, 0)
plot(h, "high", color.red,1)
plot(barsSinceBeginingOfWeek, "Bn", color.white, 2)
</code>
//@version=5
indicator("test", overlay = true)
NEWWK = timeframe.change("W")
bgcolor(NEWWK ? #7f7f7caa: na)
barsSinceBeginingOfWeek = ta.barssince(NEWWK)
var plotLine = false
barnumber = ta.barssince(NEWWK)
if barsSinceBeginingOfWeek == 3
plotline := true
h = ta.valuewhen(plotline, high, 0)
plot(h, "high", color.red,1)
plot(barsSinceBeginingOfWeek, "Bn", color.white, 2)
this is what I am trying to do, can anybody help me? Thanks
1