OPEN-SOURCE SCRIPT

ddddddrrrrrr

78
//version=5
indicator("🚀 EventSniper HF v3.0 - 高频方向信号", overlay=true)

// 参数
emaFast = input.int(5, "快速EMA")
emaSlow = input.int(20, "慢速EMA")
rsiLen = input.int(7, "RSI周期")
volRatio = input.float(1.8, "量能放大倍数")

// 指标计算
ema1 = ta.ema(close, emaFast)
ema2 = ta.ema(close, emaSlow)
rsi = ta.rsi(close, rsiLen)
volAvg = ta.sma(volume, 20)
volSpike = volume > volAvg * volRatio

// 高频方向信号(核心逻辑)
longCond = ema1 > ema2 and rsi > 50 and volSpike
shortCond = ema1 < ema2 and rsi < 50 and volSpike

// 信号绘图
plotshape(longCond, title="建议做多", location=location.belowbar, color=color.lime, style=shape.labelup, text="多")
plotshape(shortCond, title="建议做空", location=location.abovebar, color=color.red, style=shape.labeldown, text="空")

// 文本提示
label.new(longCond ? bar_index : na, low,
"📈 建议多头方向", style=label.style_label_up,
color=color.green, textcolor=color.white)

label.new(shortCond ? bar_index : na, high,
"📉 建议空头方向", style=label.style_label_down,
color=color.red, textcolor=color.white)

// 报警条件(用于接入Telegram)
alertcondition(longCond, title="📈 多方向警报", message="🚀 多方向信号触发:{{ticker}}")
alertcondition(shortCond, title="📉 空方向警报", message="🚨 空方向信号触发:{{ticker}}")

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.