PROTECTED SOURCE SCRIPT

AlgoRanger Trend Dashboard Panel

90
//version=5
indicator(" AlgoRanger Trend Dashboard Panel", overlay = true, max_lines_count = 500, max_labels_count = 500)

// === EMA Settings ===
group_ema = "๐Ÿ“Š EMA Settings"
fastLen = input.int(10, minval = 1, title = "Fast EMA Length", group = group_ema)
slowLen = input.int(50, minval = 1, title = "Slow EMA Length", group = group_ema)

// === Timeframe Settings ===
group_tf = "๐Ÿ•’ Timeframes"
tf_1m = input.timeframe("1", title = "1 Minutes", group = group_tf)
tf_5m = input.timeframe("5", title = "5 Minutes", group = group_tf)
tf_15m = input.timeframe("15", title = "15 Minutes", group = group_tf)
tf_1h = input.timeframe("60", title = "1 Hour", group = group_tf)
tf_4h = input.timeframe("240", title = "4 Hours", group = group_tf)
tf_1d = input.timeframe("D", title = "1 Day", group = group_tf)

// === Trend Detection Function ===
getTrend(_tf) =>
fast = request.security(syminfo.tickerid, _tf, ta.ema(close, fastLen))
slow = request.security(syminfo.tickerid, _tf, ta.ema(close, slowLen))
fast > slow ? "๐ŸŸข UP" : fast < slow ? "๐Ÿ”ด DOWN" : "โšช NEUTRAL"

// === Retrieve Trend Values ===
trend1 = getTrend(tf_1m)
trend5 = getTrend(tf_5m)
trend15 = getTrend(tf_15m)
trend1h = getTrend(tf_1h)
trend4h = getTrend(tf_4h)
trend1d = getTrend(tf_1d)

// === Dashboard Settings ===
group_dash = "๐Ÿ“ Dashboard Settings"
x_pos = input.int(10, title="X Offset", group=group_dash)
y_pos = input.int(20, title="Y Offset", group=group_dash)
fontSize = input.int(14, minval=10, maxval=30, title="Font Size", group=group_dash)
bgColor = input.color(color.new(#454336, 70), title="Panel Background", group=group_dash)
textColor = input.color(color.white, title="Text Color", group=group_dash)

// === Create Text with str.format() ===
dashboardText = str.format(" AlgoRanger Trend Dashboard\n1M: {0}\n5M : {1}\n15M : {2}\n1H : {3}\n4H : {4}\n1D : {5}", trend1, trend5, trend15, trend1h, trend4h, trend1d)

// === Draw the Dashboard Label ===
var label trendPanel = label.new(x = bar_index + x_pos, y = high + y_pos,
text = dashboardText, style = label.style_label_left,
textcolor = textColor, size = size.normal, color = bgColor)

label.set_xy(trendPanel, bar_index + x_pos, high + y_pos)
label.set_text(trendPanel, dashboardText)
label.set_textcolor(trendPanel, textColor)
label.set_size(trendPanel, fontSize >= 20 ? size.large : fontSize >= 14 ? size.normal : size.small)
label.set_color(trendPanel, bgColor)

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.