给你,伙计(这没有重绘),
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © SafetyHammer
//@version=4
study("My Script")
Length = input(14, minval=1, title="Stochastic Length")
smoothK = input(1, title="Smoothing of Stochastic K")
smoothD = input(3, title="Smoothing of Stochastic D")
Res_stoch_k = input(title="Stoch K Resolution", type=input.resolution, defval="60")
Res_stoch_d = input(title="Stoch D Resolution", type=input.resolution, defval="60")
f_secureSecurity(_symbol, _res, _src) => security(_symbol, _res, _src[1],barmerge.gaps_on, lookahead = barmerge.lookahead_on) // orignal code line
Sto = stoch(close, high, low, Length)
K = sma(Sto, smoothK)
D = sma(Sto, smoothD)
htf_stoch_k = f_secureSecurity(syminfo.tickerid, Res_stoch_k, K)
htf_stoch_d = f_secureSecurity(syminfo.tickerid, Res_stoch_d, D)
upper_bound = input(title="Upper Bound", type=input.integer, defval=60, minval=0, maxval=100) // User input for overbought horizontal line
lower_bound = input(title="Lower Bound", type=input.integer, defval=40, minval=0, maxval=100) // User input for oversold horizontal line
upper_hl = hline(upper_bound, title="Upper bound")
lower_hl = hline(lower_bound, title="Lower bound")
top_hl = hline(100, title="100 bound")
bottom_hl = hline(0, title="0 bound")
fill(top_hl, upper_hl, color=color.new(color.red,80))
fill(lower_hl, bottom_hl, color=color.new(color.blue,80))
plot(htf_stoch_k, title="htf_stoch K", color=color.new(color.blue,10))
plot(htf_stoch_d, title="htf stoch D", color=color.new(color.red,10))