本页源码来自 TradingView 公开发布的开源脚本,版权归原作者所有, 请遵循其原始许可(Pine 脚本常见 CC BY-NC-SA / MPL-2.0 / MIT)。 本项目仅用于研究检索与许可范围内的移植。
//@version=6
indicator("Kalshi 15m Scalping Dashboard", overlay=true, max_labels_count=100)
emaLen = input.int(9, "EMA length", minval=1)
lookback = input.int(20, "Support/resistance lookback", minval=2)
target = input.float(0.0, "Kalshi target price (0 = hidden)", step=0.0001)
showLevels = input.bool(true, "Show support and resistance")
showSignals = input.bool(true, "Show EMA/VWAP crossover markers")
ema9 = ta.ema(close, emaLen)
vw = ta.vwap(hlc3)
rsi14 = ta.rsi(close, 14)
resistance = ta.highest(high[1], lookback)
support = ta.lowest(low[1], lookback)
plot(ema9, "9 EMA", color=color.yellow, linewidth=2)
plot(vw, "VWAP", color=color.aqua, linewidth=2)
plot(showLevels ? support : na, "Support (previous bars)", color=color.lime, style=plot.style_stepline)
plot(showLevels ? resistance : na, "Resistance (previous bars)", color=color.red, style=plot.style_stepline)
plot(target > 0 ? target : na, "Kalshi target", color=color.orange, linewidth=2, style=plot.style_linebr)
bull = ta.crossover(ema9, vw)
bear = ta.crossunder(ema9, vw)
plotshape(showSignals and bull, "EMA crosses above VWAP", shape.triangleup, location.belowbar, color.lime, size=size.tiny)
plotshape(showSignals and bear, "EMA crosses below VWAP", shape.triangledown, location.abovebar, color.red, size=size.tiny)
var table dashboard = table.new(position.top_right, 2, 4, bgcolor=color.new(color.black, 20), border_width=1)
if barstate.islast
table.cell(dashboard, 0, 0, "RSI (14)", text_color=color.white)
table.cell(dashboard, 1, 0, str.tostring(rsi14, "#.0"), text_color=rsi14 >= 50 ? color.lime : color.red)
table.cell(dashboard, 0, 1, "EMA / VWAP", text_color=color.white)
table.cell(dashboard, 1, 1, ema9 > vw ? "Above" : "Below", text_color=ema9 > vw ? color.lime : color.red)
table.cell(dashboard, 0, 2, "Target", text_color=color.white)
table.cell(dashboard, 1, 2, target > 0 ? str.tostring(target, format.mintick) : "Not set", text_color=color.orange)
table.cell(dashboard, 0, 3, "Price / Target", text_color=color.white)
table.cell(dashboard, 1, 3, target > 0 ? (close >= target ? "Above" : "Below") : "—", text_color=target > 0 and close >= target ? color.lime : color.red)
alertcondition(bull, "EMA crosses above VWAP", "EMA crossed above VWAP")
alertcondition(bear, "EMA crosses below VWAP", "EMA crossed below VWAP")