indicator("我的脚本", overlay = false )
k_param = input(title="K length", defval = 14) // 默认时间
d_param= input(title = "D length", defval = 3) // SMA
rsi_param= input(title = "RSI length", defval = 7) // rsi是在0-100的区间震动 这里的输入框是震动指标的天数
upper = input(title = "Over Brought", defval = 80)
lower = input(title = "Over Sold", defval = 20)
// 震荡指标
rsi = ta.rsi(close, rsi_param) // 这里获取7天的一个震荡指标强度
// 实际震荡指标算法
Stochastic = 100 * (close - ta.lowest(low, k_param)) / (ta.highest(high, k_param) - ta.lowest(low, k_param)) // ta.lowest(low, k_param):最近14天最低点。 low是每天的最低点
SMA = ta.sma(Stochastic, k_param)
plot(upper, color = color.green, linewidth = 2, title = "Over Brought")
plot(lower, color = color.green, linewidth = 2, title = "Over Brought")
plot(rsi, color = rsi > upper ? color.red : rsi < lower ?
tradingview联系代码
最新推荐文章于 2024-09-14 09:36:15 发布