INVITE-ONLY SCRIPT

My script

15
//version=5
indicator("SMC ICT CISD with HTF Bias", overlay=true)

// Inputs
entry_tf = input.string("5m", "Entry Timeframe", options=["1m", "5m", "15m", "1H"])
htf_tf = input.string("4H", "HTF Bias Timeframe", options=["1H", "4H", "D", "W"])
lookback_cisd = input.int(20, "CISD Lookback", minval=1)
fvg_sensitivity = input.float(0.5, "FVG Sensitivity (%)", minval=0.1, step=0.1)
ob_lookback = input.int(10, "Order Block Lookback", minval=1)
liq_threshold = input.float(1.0, "Liquidity Threshold (%)", minval=0.1, step=0.1)

// HTF High/Low/Mid
htf_high = request.security(syminfo.tickerid, htf_tf, high[1], lookahead=barmerge.lookahead_on)
htf_low = request.security(syminfo.tickerid, htf_tf, low[1], lookahead=barmerge.lookahead_on)
htf_mid = (htf_high + htf_low) / 2

// Bias Conditions
bias_strong_bull = close > htf_high
bias_bull = close > htf_mid and close <= htf_high
bias_bear = close <= htf_mid and close >= htf_low
bias_strong_bear = close < htf_low

// Bearish CISD Detection
bearish_cisd = close < open[1] and open[1] > close[1] and not ta.crossover(low, htf_low[1])
cisd_signal = bearish_cisd ? 1 : 0

// Fair Value Gap (Bearish FVG)
fvg_bearish = low[1] > high[2] * (1 + fvg_sensitivity / 100)
fvg_top = fvg_bearish ? low[1] : na
fvg_bottom = fvg_bearish ? high[2] : na
fvg_valid = fvg_bearish and close < fvg_bottom and close > fvg_bottom - (fvg_top - fvg_bottom)

// Order Block (Bearish OB)
bearish_ob = high[1] == ta.highest(high, ob_lookback) and close < open[1]
ob_price = bearish_ob ? high[1] : na
ob_valid = bearish_ob and close < ob_price

// Liquidity Sweep (Above PD High)
pd_high = request.security(syminfo.tickerid, "D", high[1], lookahead=barmerge.lookahead_on)
pd_low = request.security(syminfo.tickerid, "D", low[1], lookahead=barmerge.lookahead_on)
liq_sweep = high > pd_high * (1 + liq_threshold / 100) and close < pd_high

// Confluence Check
confluence = cisd_signal and fvg_valid and ob_valid and liq_sweep and (bias_bear or bias_strong_bear)

// Entry, SL, and TP Logic
entry_price = confluence ? close : na
sl_price = confluence ? high + (high - low) * 0.5 : na
tp_price = confluence ? pd_low : na

// Plot HTF Levels
plot(htf_high, "HTF High", color=color.red, linewidth=1)
plot(htf_mid, "HTF Mid", color=color.gray, linewidth=1)
plot(htf_low, "HTF Low", color=color.green, linewidth=1)

// Plot SMC/ICT Signals
plotshape(confluence, "Bearish CISD Entry", shape.triangleup, location.belowbar, color=color.red, size=size.small)
plot(entry_price, "Entry", color=color.red, style=plot.style_crosses)
plot(sl_price, "Stop Loss", color=color.red, style=plot.style_dashed)
plot(tp_price, "Take Profit", color=color.green, style=plot.style_dashed)
plotshape(fvg_valid, "FVG", shape.diamond, location.belowbar, color=color.blue, size=size.tiny)
plotshape(ob_valid, "OB", shape.square, location.abovebar, color=color.purple, size=size.tiny)

// Visual Bias Label
var label biasLabel = na
if bar_index % 5 == 0
label.delete(biasLabel)
biasText = bias_strong_bull ? "Strong Bullish" :
bias_bull ? "Bullish Bias" :
bias_bear ? "Bearish Bias (Discount)" :
"Strong Bearish"
biasColor = bias_strong_bull ? color.lime :
bias_bull ? color.green :
bias_bear ? color.orange :
color.red
biasLabel := label.new(bar_index, close, biasText, style=label.style_label_right, textcolor=color.white, color=biasColor)

// Alerts
alertcondition(confluence, title="Bearish CISD Confluence", message="Bearish CISD with OB, FVG, Liquidity Sweep, and HTF Bias")

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。