You'll need arrays to maintain the his/los manually so you can skip the "1130-1429" bars:
//@version=4
study("")
ilong = 10 // period
isigK = 3
isigD = 3
// Maintain list of last `ilong` his/los manually in arrays.
var his = array.new_float(ilong)
var los = array.new_float(ilong)
notInSession = na(time(timeframe.period, "1130-1429:1234567"))
if notInSession
// We are outside session time; q and dq new high/low.
array.shift(his)
array.push(his, high)
array.shift(los)
array.push(los, low)
c = close
h = array.max(his)
l = array.min(los)
RSV = 100*((c-l)/(h-l))
pK = sma(RSV, isigK)
pD = sma(pK, isigD)
pJ = 3 * pK - 2 * pD
plot(pK, color=color.red)
plot(pD, color=color.blue)
plot(pJ, color=color.green)
// For session validation in pane.
plotchar(notInSession, "notInSession", "?", location.top, size = size.tiny)
// For validation in Data Window.
plotchar(h, "h", "", location.top, size = size.tiny)
plotchar(l, "l", "", location.top, size = size.tiny)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…