OPEN-SOURCE SCRIPT

RSI EMA Moving Average Strategy

//version=6
indicator("RSI EMA Moving Average Strategy", overlay=true)

// Inputlar
RSI_Period = input.int(14, title="RSI davri")
RSI_Buy_Level = input.int(20, title="RSI Buy darajasi")
RSI_Sell_Level = input.int(80, title="RSI Sell darajasi")
EMA_Period = input.int(100, title="EMA davri")
Liquidity_Range = input.int(10, title="Likvidlik zonasi uchun barlar soni")

// Indikatorlar hisob-kitobi
rsi = ta.rsi(close, RSI_Period)
ema = ta.ema(close, EMA_Period)

// Likvidlik darajalarini aniqlash
highLiquidity = ta.highest(high, Liquidity_Range)
lowLiquidity = ta.lowest(low, Liquidity_Range)

// Signal shartlari
var string signal = na
var label buyLabel = na
var label sellLabel = na
var label exitLabel = na

if (rsi < RSI_Buy_Level and close > ema and close > lowLiquidity)
signal := "Buy"
label.delete(buyLabel)
buyLabel := label.new(bar_index, close, "Buy", style=label.style_label_down, color=color.green)
alert("Buy signali topildi!", alert.freq_once_per_bar)

if (rsi > RSI_Sell_Level and close < ema and close < highLiquidity)
signal := "Sell"
label.delete(sellLabel)
sellLabel := label.new(bar_index, close, "Sell", style=label.style_label_up, color=color.red)
alert("Sell signali topildi!", alert.freq_once_per_bar)

if ((close < ema and signal == "Buy") or (close > ema and signal == "Sell"))
label.delete(exitLabel)
exitLabel := label.new(bar_index, close, "Exit", style=label.style_label_down, color=color.yellow)
alert("Exit signali topildi!", alert.freq_once_per_bar)
Breadth Indicators

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