OPEN-SOURCE SCRIPT
Empty Candle

//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)
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一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。