I am trying to get only last week high/low values,NOT all weeks values
t = input(title = "study", defval="W", options=["D","W"])
shigh = security(tickerid, t, high[1], barmerge.gaps_off, barmerge.lookahead_on)
slow = security(tickerid, t, low[1], barmerge.gaps_off, barmerge.lookahead_on)
r = shigh-slow
center=(sclose)
h1=sclose + r*(1.1/12)
c5=sopen != sopen[1] ? na : red
plot(h5, title="H5",color=c5, linewidth=2)
As you can see in the chart are displayed all weeks since creation...I want only last week!not to show all of them into the chart.
Can someone show me how its done?
question from:https://stackoverflow.com/questions/65867916/only-last-week-value-pine-script