OPEN-SOURCE SCRIPT

Futures Momentum Scanner – jyoti

57
//version=5
indicator("Futures Momentum Scanner – Avvu Edition", overlay=false, max_lines_count=500)

//------------------------------
// USER INPUTS
//------------------------------
rsiLen = input.int(14, "RSI Length")
macdFast = input.int(12, "MACD Fast")
macdSlow = input.int(26, "MACD Slow")
macdSignal = input.int(9, "MACD Signal")
stLength = input.int(10, "Supertrend Length")
stMult = input.float(3.0, "Supertrend Multiplier")

//------------------------------
// SUPER TREND
//------------------------------
[supertrend, stDirection] = ta.supertrend(stMult, stLength)
trendUp = stDirection == 1

//------------------------------
// RSI
//------------------------------
rsi = ta.rsi(close, rsiLen)
rsiBull = rsi > 50 and rsi < 65

//------------------------------
// MACD
//------------------------------
[macd, signal, hist] = ta.macd(close, macdFast, macdSlow, macdSignal)
macdBull = macd > signal and macd > 0

//------------------------------
// MOVING AVERAGE TREND
//------------------------------
ema20 = ta.ema(close, 20)
ema50 = ta.ema(close, 50)
ema200 = ta.ema(close, 200)

trendStack = ema20 > ema50 and ema50 > ema200

//------------------------------
// BREAKOUT LOGIC
//------------------------------
prevHigh = ta.highest(high, 20)
breakout = close > prevHigh

//------------------------------
// FINAL SCANNER LOGIC
//------------------------------
bullishCandidate = trendUp and rsiBull and macdBull and trendStack and breakout

//------------------------------
// TABLE OUTPUT FOR SCANNER FEEL
//------------------------------
var table t = table.new(position.top_right, 1, 1)

if barstate.islast
msg = bullishCandidate ? "✔ BUY Candidate" : "– Not a Setup"
table.cell(t, 0, 0, msg, bgcolor=bullishCandidate ? color.new(color.green, 0) : color.new(color.red, 70))

//------------------------------
// ALERT
//------------------------------
alertcondition(bullishCandidate, title="Scanner Trigger", message="This stock meets Avvu's futures scanner criteria!")

Thông báo miễn trừ trách nhiệm

Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.