OPEN-SOURCE SCRIPT

SMA Crossover Bot for Bybit

//version=5
indicator("SMA Crossover Bot for Bybit", overlay=true)

// Ввод параметров
sma5_length = input(5, "Длина SMA5")
sma20_length = input(20, "Длина SMA20")

// Вычисление скользящих средних
sma5 = ta.sma(close, sma5_length)
sma20 = ta.sma(close, sma20_length)

// Сигналы пересечения
buy_signal = ta.crossover(sma5, sma20) // SMA5 пересекает SMA20 снизу вверх
sell_signal = ta.crossunder(sma5, sma20) // SMA5 пересекает SMA20 сверху вниз

// Отправка сигнала через Webhook
if (buy_signal)
alert("BUY_SIGNAL", alert.freq_once_per_bar_close)
if (sell_signal)
alert("SELL_SIGNAL", alert.freq_once_per_bar_close)

// Отображение на графике
plot(sma5, color=color.green, title="SMA5")
plot(sma20, color=color.red, title="SMA20")

plotshape(buy_signal, style=shape.labelup, location=location.belowbar, color=color.green, text="BUY")
plotshape(sell_signal, style=shape.labeldown, location=location.abovebar, color=color.red, text="SELL")
forecasting

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer