OPEN-SOURCE SCRIPT

CSP Entry Signal

//version=5
indicator("CSP Entry Signal", overlay=true)

// RSI Calculation
rsiLength = 14
rsiSource = close
rsiValue = ta.rsi(rsiSource, rsiLength)

// Moving Averages for Trend Confirmation
ema200 = ta.ema(close, 200)

// MACD Histogram for Momentum Confirmation
[macdLine, signalLine, macdHist] = ta.macd(close, 12, 26, 9)

// Support Level Detection (Simple Moving Low)
supportLookback = 20
supportLevel = ta.lowest(low, supportLookback)

// Implied Volatility Approximation (Using ATR as a Proxy)
atrLength = 14
atrValue = ta.atr(atrLength)

// Entry Conditions
rsiCondition = rsiValue < 55
trendCondition = close > ema200 and macdHist > 0
supportCondition = close <= supportLevel

// Final Entry Signal
cspEntrySignal = rsiCondition and trendCondition and supportCondition

// Plot Support Level
plot(supportLevel, title="Support Level", color=color.blue, linewidth=2, style=plot.style_stepline)

// Plot Entry Signal
plotshape(cspEntrySignal, location=location.belowbar, color=color.green, style=shape.labelup, size=size.small, title="CSP Entry")

// Alert Condition
alertcondition(cspEntrySignal, title="CSP Entry Alert", message="CSP Entry Signal Triggered")
Candlestick analysis

开源脚本

本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受网站规则约束。 您可以收藏它以在图表上使用。

想在图表上使用此脚本?

免责声明