← К каталогу
Исходный код · ID 5008

Smart Money Sniper X

indicator smart money sniper x for tradingview.pine
Вы автор или правообладатель?

Сообщите нам, если считаете, что материал размещён без разрешения.

Краткий обзор

О программе

Smart Money Sniper X — это индикатор для TradingView, написанный на Pine Script v6 и отображаемый поверх графика. Он объединяет концепции Smart Money с классическими техническими расчётами для анализа ликвидности и рыночной структуры.

Индикатор рассчитывает уровни ликвидности на основе свинг-пивотов, определяет захваты ликвидности, сдвиги рыночной структуры (MSS), справедливые разрывы цен (FVG), блоки ордеров и зоны премии/дисконта. Для фильтрации сигналов используется сглаженная скользящая средя на старшем таймфрейме.

При совпадении нескольких условий индикатор формирует сигналы покупки и продажи, отображает автоматические уровни входа и три целевых уровня, рассчитанных через множители ATR. Встроенная информационная панель показывает текущий тренд старшего ТФ, состояние ликвидности, структуру и последний сигнал. Поддерживаются условия оповещений TradingView.

Настройки программы

НастройкаОписание
pivotLen Количество баров слева и справа для определения свинг-пивотов высоких и низких значений.
equalTolerance Допустимый процент отклонения для определения равенства двух последовательных высоких или низких уровней.
showLiquidity Включает или отключает отображение горизонтальных уровней ликвидности и меток равных высоких/низких значений.
showSweeps Включает или отключает отображение графических маркеров захвата ликвидности на графике.
atrLen Период расчёта индикатора средних истинных диапазонов (ATR), используемого для определения силы свечи и расчёта целевых уровней.
displacementATR Минимальное относительное значение тела свечи в единицах ATR, при котором свеча считается направленной (бычьей или медвежьей).
setupValidity Количество баров, в течение которых активен сигнал захвата ликвидности после его возникновения.
cooldownBars Количество баров ожидания между последовательными сигналами после генерации сигнала покупки или продажи.
useHTF Включает или отключает фильтрацию сигналов по тренду на старшем таймфрейме. При отключённом фильтре сигналы генерируются без учёта старшего ТФ.
htf Старший таймфрейм, с которого загружаются данные для фильтрации тренда и расчёта скользящей средней.
emaLen Период экспоненциальной скользящей средней, рассчитываемой на старшем таймфрейме для определения общего тренда.
showFVG Включает или отключает отображение зон справедливых разрывов цен (Fair Value Gaps) на графике.
showOB Включает или отключает отображение зон блоков ордеров (Order Blocks) при появлении сигнала.
showPD Включает или отключает отображение зон премии и дисконта относительно последнего свинг-пивота.
zoneBars Количество баров вправо, на которых продлеваются графические зоны уровней, блоков ордеров и разрывов цен.
showTargets Включает или отключает отображение линий и меток уровня входа и трёх целевых уровней после сигнала.
tp1ATR Множитель ATR для расчёта первого целевого уровня от цены входа.
tp2ATR Множитель ATR для расчёта второго целевого уровня от цены входа.
tp3ATR Множитель ATR для расчёта третьего целевого уровня от цены входа.
rightBars Расстояние в барах от текущего бара до размещения горизонтальных линий и меток входа и целевых уровней справа на графике.
showDashboard Включает или отключает отображение информационной панели в правом верхнем углу графика с данными о тренде, ликвидности, структуре и последнем сигнале.

Поиск по коду файла

indicator("Smart Money Sniper X", overlay=true, max_lines_count=100, max_labels_count=100, max_boxes_count=50)

groupSMC = "Smart Money Settings"
pivotLen       = input.int(5, "Swing Pivot Length", minval=2, group=groupSMC)
equalTolerance = input.float(0.15, "Equal High/Low Tolerance %", minval=0.01, step=0.01, group=groupSMC)
showLiquidity  = input.bool(true, "Show Liquidity Levels", group=groupSMC)
showSweeps     = input.bool(true, "Show Liquidity Sweep Signals", group=groupSMC)

groupSignal = "Sniper Signal Settings"
atrLen          = input.int(14, "ATR Length", minval=1, group=groupSignal)
displacementATR = input.float(0.8, "Displacement Body ATR", minval=0.1, step=0.1, group=groupSignal)
setupValidity   = input.int(10, "Sweep Setup Validity Bars", minval=1, group=groupSignal)
cooldownBars    = input.int(5, "Signal Cooldown Bars", minval=0, group=groupSignal)

groupHTF = "Higher Timeframe Filter"
useHTF   = input.bool(true, "Enable HTF Trend Filter", group=groupHTF)
htf      = input.timeframe("60", "Higher Timeframe", group=groupHTF)
emaLen   = input.int(50, "HTF EMA Length", minval=1, group=groupHTF)

groupZones = "Smart Money Zones"
showFVG   = input.bool(true, "Show Fair Value Gaps", group=groupZones)
showOB    = input.bool(true, "Show Order Blocks", group=groupZones)
showPD    = input.bool(true, "Show Premium / Discount", group=groupZones)
zoneBars  = input.int(40, "Zone Extension Bars", minval=5, maxval=300, group=groupZones)

groupTargets = "Automatic Entry & Targets"
showTargets = input.bool(true, "Show Entry & Targets", group=groupTargets)
tp1ATR      = input.float(1.0, "TP1 ATR Multiplier", minval=0.1, step=0.1, group=groupTargets)
tp2ATR      = input.float(2.0, "TP2 ATR Multiplier", minval=0.1, step=0.1, group=groupTargets)
tp3ATR      = input.float(3.0, "TP3 ATR Multiplier", minval=0.1, step=0.1, group=groupTargets)
rightBars   = input.int(20, "Right-Side Label Distance", minval=5, maxval=200, group=groupTargets)

groupDashboard = "Dashboard"
showDashboard  = input.bool(true, "Show Dashboard", group=groupDashboard)

atr = ta.atr(atrLen)
bodySize = math.abs(close - open)

bullDisplacement = close > open and bodySize >= atr * displacementATR
bearDisplacement = close < open and bodySize >= atr * displacementATR

ph = ta.pivothigh(high, pivotLen, pivotLen)
pl = ta.pivotlow(low, pivotLen, pivotLen)

var float lastHigh = na
var float previousHigh = na
var float lastLow = na
var float previousLow = na

if not na(ph)
    previousHigh := lastHigh
    lastHigh := ph

if not na(pl)
    previousLow := lastLow
    lastLow := pl

htfClose = request.security(syminfo.tickerid, htf, close[1], lookahead=barmerge.lookahead_on)
htfEMA = request.security(syminfo.tickerid, htf, ta.ema(close, emaLen)[1], lookahead=barmerge.lookahead_on)

htfBull = htfClose > htfEMA
htfBear = htfClose < htfEMA

allowBuy = not useHTF or htfBull
allowSell = not useHTF or htfBear

equalHigh = not na(lastHigh) and not na(previousHigh) and math.abs(lastHigh - previousHigh) / previousHigh * 100 <= equalTolerance
equalLow = not na(lastLow) and not na(previousLow) and math.abs(lastLow - previousLow) / previousLow * 100 <= equalTolerance

var line buyLiquidityLine = na
var line sellLiquidityLine = na
var label buyLiquidityLabel = na
var label sellLiquidityLabel = na

if not na(ph) and showLiquidity
    if not na(buyLiquidityLine)
        line.delete(buyLiquidityLine)
    if not na(buyLiquidityLabel)
        label.delete(buyLiquidityLabel)

    buyLiquidityLine := line.new(bar_index - pivotLen, ph, bar_index + zoneBars, ph, color=color.new(color.red, 15), style=line.style_dashed, width=1)
    buyLiquidityLabel := label.new(bar_index + zoneBars, ph, equalHigh ? "EQUAL HIGHS / BSL" : "BUY-SIDE LIQUIDITY", style=label.style_label_left, color=color.new(color.red, 15), textcolor=color.white, size=size.tiny)

if not na(pl) and showLiquidity
    if not na(sellLiquidityLine)
        line.delete(sellLiquidityLine)
    if not na(sellLiquidityLabel)
        label.delete(sellLiquidityLabel)

    sellLiquidityLine := line.new(bar_index - pivotLen, pl, bar_index + zoneBars, pl, color=color.new(color.lime, 15), style=line.style_dashed, width=1)
    sellLiquidityLabel := label.new(bar_index + zoneBars, pl, equalLow ? "EQUAL LOWS / SSL" : "SELL-SIDE LIQUIDITY", style=label.style_label_left, color=color.new(color.green, 15), textcolor=color.white, size=size.tiny)

bullSweep = not na(lastLow) and low < lastLow and close > lastLow
bearSweep = not na(lastHigh) and high > lastHigh and close < lastHigh

var int bullSweepBar = na
var int bearSweepBar = na

if bullSweep
    bullSweepBar := bar_index

if bearSweep
    bearSweepBar := bar_index

bullSweepActive = not na(bullSweepBar) and bar_index - bullSweepBar <= setupValidity
bearSweepActive = not na(bearSweepBar) and bar_index - bearSweepBar <= setupValidity

if not na(bullSweepBar) and bar_index - bullSweepBar > setupValidity
    bullSweepBar := na

if not na(bearSweepBar) and bar_index - bearSweepBar > setupValidity
    bearSweepBar := na

plotshape(showSweeps and bullSweep, title="Bullish Liquidity Sweep", style=shape.triangleup, location=location.belowbar, color=color.lime, size=size.small, text="SWEEP")
plotshape(showSweeps and bearSweep, title="Bearish Liquidity Sweep", style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small, text="SWEEP")

bullMSS = not na(lastHigh) and close > lastHigh and close[1] <= lastHigh
bearMSS = not na(lastLow) and close < lastLow and close[1] >= lastLow

plotshape(bullMSS, title="Bullish MSS", style=shape.labelup, location=location.belowbar, color=color.new(color.green, 10), text="MSS", textcolor=color.white, size=size.tiny)
plotshape(bearMSS, title="Bearish MSS", style=shape.labeldown, location=location.abovebar, color=color.new(color.red, 10), text="MSS", textcolor=color.white, size=size.tiny)

var int lastSignalBar = na

cooldownOK = na(lastSignalBar) or bar_index - lastSignalBar > cooldownBars

buySignal = bullSweepActive and bullMSS and bullDisplacement and allowBuy and cooldownOK and barstate.isconfirmed
sellSignal = bearSweepActive and bearMSS and bearDisplacement and allowSell and cooldownOK and barstate.isconfirmed

if buySignal or sellSignal
    lastSignalBar := bar_index
    bullSweepBar := na
    bearSweepBar := na

plotshape(buySignal, title="SNIPER BUY", style=shape.labelup, location=location.belowbar, color=color.rgb(0, 160, 100), text="SNIPER\nBUY", textcolor=color.white, size=size.normal)
plotshape(sellSignal, title="SNIPER SELL", style=shape.labeldown, location=location.abovebar, color=color.rgb(210, 45, 55), text="SNIPER\nSELL", textcolor=color.white, size=size.normal)

bullFVG = low > high[2]
bearFVG = high < low[2]

var box bullFVGBox = na
var box bearFVGBox = na

if showFVG and bullFVG and barstate.isconfirmed
    if not na(bullFVGBox)
        box.delete(bullFVGBox)
    bullFVGBox := box.new(bar_index - 2, low, bar_index + zoneBars, high[2], bgcolor=color.new(color.green, 88), border_color=color.new(color.green, 40), text="BULLISH FVG", text_color=color.green, text_size=size.tiny)

if s

Показано первые 50% кода (символов: 12110)