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!")

Aviso legal

As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.