OPEN-SOURCE SCRIPT

DSL Oscillator Emeson Bareno

//version=5
indicator("DSL Oscillator", overlay=false)

// Input Parameters
length = input.int(14, minval=1, title="Length")
smoothing1 = input.int(3, minval=1, title="First Smoothing Length")
smoothing2 = input.int(3, minval=1, title="Second Smoothing Length")

// Calculate Price Data
price = close

// Double Smoothing Process
ema1 = ta.ema(price, smoothing1)
ema2 = ta.ema(ema1, smoothing2)

// DSL Calculation
dsl = ta.ema(ema2, length)

// Signal Thresholds
buy_level = input.float(0.1, title="Buy Threshold", tooltip="Threshold for generating buy signals")
sell_level = input.float(-0.1, title="Sell Threshold", tooltip="Threshold for generating sell signals")

// Buy and Sell Signals
buy_signal = ta.crossover(dsl, buy_level)
sell_signal = ta.crossunder(dsl, sell_level)

// Plot DSL Oscillator
plot(dsl, color=color.blue, linewidth=2, title="DSL Oscillator")
hline(buy_level, "Buy Level", color=color.green, linestyle=hline.style_dotted)
hline(sell_level, "Sell Level", color=color.red, linestyle=hline.style_dotted)

// Signal Markers
plotshape(buy_signal, style=shape.labelup, color=color.green, location=location.belowbar, size=size.small, title="Buy Signal")
plotshape(sell_signal, style=shape.labeldown, color=color.red, location=location.abovebar, size=size.small, title="Sell Signal")
Bands and ChannelsBreadth IndicatorsCandlestick analysis

開源腳本

在真正的TradingView精神中,這個腳本的作者以開源的方式發佈,這樣交易員可以理解和驗證它。請向作者致敬!您可以免費使用它,但在出版物中再次使用這段程式碼將受到網站規則的約束。 您可以收藏它以在圖表上使用。

想在圖表上使用此腳本?

免責聲明