Untitled

 avatar
unknown
plain_text
a month ago
2.4 kB
1
Indexable
//@version=6
indicator("RSI ve MA Kesişim Taraması (Çoklu Parite)", overlay=true)

// Kullanılacak sembolleri belirtin
symbols = input.string("BINANCE:BTCUSDT,BINANCE:ETHUSDT,BINANCE:SOLUSDT", title="Semboller (Virgülle Ayrılmış)")

// Parametreler
rsi_length = input.int(14, title="RSI Periyodu")
ma_length = input.int(9, title="Hareketli Ortalama Periyodu")

// Fonksiyon: Bir sembol için RSI ve kesişimleri kontrol eder
check_rsi_cross(symbol) =>
    price = request.security(symbol, timeframe.period, close)  // Sembolün kapanış fiyatı
    rsi = ta.rsi(price, rsi_length)  // RSI hesaplama
    rsi_ma = ta.sma(rsi, ma_length)  // RSI'nın hareketli ortalaması
    crossover_signal = ta.crossover(rsi, rsi_ma)  // Yukarı kesişim
    crossunder_signal = ta.crossunder(rsi, rsi_ma)  // Aşağı kesişim
    [rsi, rsi_ma, crossover_signal, crossunder_signal]

// Sembolleri işleme
var string[] symbol_list = str.split(symbols, ",")
var table results_table = table.new(position.top_right, 5, 10, border_width=1)

// Tablo başlıkları
if (bar_index == 0)
    table.cell(results_table, 0, 0, "Sembol", bgcolor=color.gray, text_color=color.white)
    table.cell(results_table, 0, 1, "RSI", bgcolor=color.gray, text_color=color.white)
    table.cell(results_table, 0, 2, "RSI MA", bgcolor=color.gray, text_color=color.white)
    table.cell(results_table, 0, 3, "↑ Kesişim", bgcolor=color.gray, text_color=color.white)
    table.cell(results_table, 0, 4, "↓ Kesişim", bgcolor=color.gray, text_color=color.white)

// Tabloda sonuçları gösterme
for i = 0 to array.size(symbol_list) - 1
    symbol = str.trim(array.get(symbol_list, i))
    [rsi, rsi_ma, crossover_signal, crossunder_signal] = check_rsi_cross(symbol)
    table.cell(results_table, i + 1, 0, symbol, bgcolor=color.gray, text_color=color.white)
    table.cell(results_table, i + 1, 1, str.tostring(rsi, format.mintick), bgcolor=color.new(color.blue, 60), text_color=color.white)
    table.cell(results_table, i + 1, 2, str.tostring(rsi_ma, format.mintick), bgcolor=color.new(color.orange, 60), text_color=color.white)
    table.cell(results_table, i + 1, 3, crossover_signal ? "Evet" : "Hayır", bgcolor=crossover_signal ? color.green : color.new(color.white, 60), text_color=color.white)
    table.cell(results_table, i + 1, 4, crossunder_signal ? "Evet" : "Hayır", bgcolor=crossunder_signal ? color.red : color.new(color.white, 60), text_color=color.white)
Editor is loading...
Leave a Comment