OPEN-SOURCE SCRIPT

Empty Candle

32
//version=5
indicator("5–6 signals per day (Stable)", overlay=true)

// ─────── Inputs ───────
emaLen = input.int(50, "EMA Length", minval=10)
rsiLen = input.int(14, "RSI Length", minval=5)
volMult = input.float(1.3, "Volume multiplier", minval=1.0, step=0.1)
rsiOverb = input.int(65, "RSI Overbought", minval=50, maxval=90)
rsiOvers = input.int(35, "RSI Oversold", minval=10, maxval=50)

// ─────── Calculations ───────
ema = ta.ema(close, emaLen)
rsi = ta.rsi(close, rsiLen)
volMA = ta.sma(volume, 20)

// ─────── Trend ───────
bullTrend = close > ema
bearTrend = close < ema
volSpike = volume > volMA * volMult

// ─────── Base conditions ───────
baseBuy = bullTrend and rsi < rsiOvers and volSpike and close > open
baseSell = bearTrend and rsi > rsiOverb and volSpike and close < open

// ─────── EMA press logic ───────
emaPressBuy = close > open and open < ema and close > ema
emaPressSell = close < open and open > ema and close < ema

// ─────── Final signals ───────
buyCond = baseBuy or emaPressBuy
sellCond = baseSell or emaPressSell

// ─────── Signals (STRICTLY BAR-ANCHORED) ───────
plotshape(
buyCond,
title="BUY",
style=shape.triangleup,
location=location.belowbar,
color=color.lime,
size=size.small
)

plotshape(
sellCond,
title="SELL",
style=shape.triangledown,
location=location.abovebar,
color=color.red,
size=size.small
)

// ─────── EMA ───────
plot(ema, title="EMA", color=color.new(color.blue, 30), linewidth=2)

免责声明

这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。