OPEN-SOURCE SCRIPT

LUCY Multi-Timeframe Bias Checker

70
//version=5
indicator("LUCY Multi-Timeframe Bias Checker", overlay=true)

// === INPUTS === //
emaShort = input.int(8, title="Short EMA")
emaLong = input.int(34, title="Long EMA")

// === CURRENT TIMEFRAME === //
emaShort_curr = ta.ema(close, emaShort)
emaLong_curr = ta.ema(close, emaLong)
bias_curr = emaShort_curr > emaLong_curr ? "Bullish" : "Bearish"

// === HIGHER TIMEFRAMES === //
emaShort_5m = request.security(syminfo.tickerid, "5", ta.ema(close, emaShort))
emaLong_5m = request.security(syminfo.tickerid, "5", ta.ema(close, emaLong))
bias_5m = emaShort_5m > emaLong_5m ? "Bullish" : "Bearish"

emaShort_15m = request.security(syminfo.tickerid, "15", ta.ema(close, emaShort))
emaLong_15m = request.security(syminfo.tickerid, "15", ta.ema(close, emaLong))
bias_15m = emaShort_15m > emaLong_15m ? "Bullish" : "Bearish"

// === PANEL DISPLAY === //
var table biasTable = table.new(position.top_right, 2, 4, border_width=1)

if bar_index % 5 == 0
table.cell(biasTable, 0, 0, "Timeframe", bgcolor=color.black, text_color=color.white)
table.cell(biasTable, 1, 0, "Bias", bgcolor=color.black, text_color=color.white)

table.cell(biasTable, 0, 1, "1-Min", bgcolor=color.gray)
table.cell(biasTable, 1, 1, bias_curr, bgcolor=bias_curr == "Bullish" ? color.green : color.red, text_color=color.white)

table.cell(biasTable, 0, 2, "5-Min", bgcolor=color.gray)
table.cell(biasTable, 1, 2, bias_5m, bgcolor=bias_5m == "Bullish" ? color.green : color.red, text_color=color.white)

table.cell(biasTable, 0, 3, "15-Min", bgcolor=color.gray)
table.cell(biasTable, 1, 3, bias_15m, bgcolor=bias_15m == "Bullish" ? color.green : color.red, text_color=color.white)

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.