Ladder Indicator (优化版)

indicator("Ladder Indicator (优化版)", overlay=true)
// 参数
n1 = input.int(26, title="短周期N1")
n2 = input.int(89, title="长周期N2")
// 计算短周期EMA
ema_high_n1 = ta.ema(high, n1)
ema_low_n1 = ta.ema(low, n1)
// 计算长周期EMA
ema_high_n2 = ta.ema(high, n2)
ema_low_n2 = ta.ema(low, n2)
// 定义颜色
color_short = color.blue
color_long = color.yellow
// 短周期条件:收盘在两条线之间
short_band_top = close > ema_high_n1 ? ema_high_n1 : close < ema_low_n1 ? ema_low_n1 : na
short_band_bottom = close > ema_high_n1 ? ema_low_n1 : close < ema_low_n1 ? ema_high_n1 : na
// 长周期条件:收盘在两条线之间
long_band_top = close > ema_high_n2 ? ema_high_n2 : close < ema_low_n2 ? ema_low_n2 : na
long_band_bottom = close > ema_high_n2 ? ema_low_n2 : close < ema_low_n2 ? ema_high_n2 : na
// 绘制短周期梯子(蓝色带)
plot1 = plot(short_band_top, color=color_short, style=plot.style_stepline, linewidth=1)
plot2 = plot(short_band_bottom, color=color_short, style=plot.style_stepline, linewidth=1)
fill(plot1, plot2, color=color_short, transp=70)
// 绘制长周期梯子(黄色带)
plot3 = plot(long_band_top, color=color_long, style=plot.style_stepline, linewidth=1)
plot4 = plot(long_band_bottom, color=color_long, style=plot.style_stepline, linewidth=1)
fill(plot3, plot4, color=color_long, transp=70)
// 绘制K线
plotcandle(open, high, low, close)
Invite-only script
Only users approved by the author can access this script. You'll need to request and get permission to use it. This is typically granted after payment. For more details, follow the author's instructions below or contact zijing0592 directly.
TradingView does NOT recommend paying for or using a script unless you fully trust its author and understand how it works. You may also find free, open-source alternatives in our community scripts.
Author's instructions
Disclaimer
Invite-only script
Only users approved by the author can access this script. You'll need to request and get permission to use it. This is typically granted after payment. For more details, follow the author's instructions below or contact zijing0592 directly.
TradingView does NOT recommend paying for or using a script unless you fully trust its author and understand how it works. You may also find free, open-source alternatives in our community scripts.