//@version=4
study("My Script", overlay=true)
t = input(title = "study", defval="W", options=["D","W"])
[sopen, shigh, slow, sclose] = security(syminfo.tickerid, t, [open[1], high[1],low[1],close[1]], barmerge.gaps_off, barmerge.lookahead_on)
r = shigh-slow
center = (sclose)
h5 = sclose + r*(1.1/12)
c5 = sopen != sopen[1] ? na : color.red
plot(h5, title="H5",color=c5, linewidth=2)
Update: only show current week.
//@version=4
study("My Script", overlay=true)
t = input(title = "study", defval="W", options=["D","W"])
thisweek = year(timenow) == year(time) and weekofyear(timenow) == weekofyear(time)
[sopen, shigh, slow, sclose] = security(syminfo.tickerid, t, [open[1], high[1],low[1],close[1]], barmerge.gaps_off, barmerge.lookahead_on)
r = shigh-slow
center = (sclose)
h5 = sclose + r*(1.1/12)
c5 = sopen != sopen[1] ? na : color.red
plot(thisweek ? h5 : na, title="H5",color=c5, linewidth=2)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…