OPEN-SOURCE SCRIPT
AI Liquidity Confirmation Framework [Signals + RR]

//version=6
indicator("AI Liquidity Confirmation Framework [Signals + RR]", overlay=true)
// ----------------------
// Inputs
// ----------------------
atrLen = input.int(14, "ATR Length")
rr = input.float(2.0, "Risk Reward", step=0.25)
confirmBars = input.int(1, "Confirmation Bars")
// ----------------------
// Core Calculations
// ----------------------
atr = ta.atr(atrLen)
// Liquidity levels (simple swing logic)
sellLiquidity = ta.highest(high, 10)
buyLiquidity = ta.lowest(low, 10)
// Sweep detection
sellSweep = high > sellLiquidity[1] and close < sellLiquidity[1]
buySweep = low < buyLiquidity[1] and close > buyLiquidity[1]
// Confirmation candles
bullConfirm = close > open and close > close[1]
bearConfirm = close < open and close < close[1]
// ----------------------
// Trade Logic
// ----------------------
buySignal = buySweep and bullConfirm
sellSignal = sellSweep and bearConfirm
// Risk management
buyStop = low - atr
sellStop = high + atr
buyTarget = close + (close - buyStop) * rr
sellTarget = close - (sellStop - close) * rr
// ----------------------
// Plot Signals
// ----------------------
plotshape(buySignal, title="BUY", style=shape.labelup, text="BUY", color=color.new(color.green, 0))
plotshape(sellSignal, title="SELL", style=shape.labeldown, text="SELL", color=color.new(color.red, 0))
// Stops & Targets
plot(buySignal ? buyStop : na, color=color.red, style=plot.style_linebr)
plot(buySignal ? buyTarget : na, color=color.green, style=plot.style_linebr)
plot(sellSignal ? sellStop : na, color=color.red, style=plot.style_linebr)
plot(sellSignal ? sellTarget : na, color=color.green, style=plot.style_linebr)
// ----------------------
// WAIT State
// ----------------------
waitState = not buySignal and not sellSignal
plotchar(waitState, title="WAIT", char=".", location=location.top, color=color.gray)
indicator("AI Liquidity Confirmation Framework [Signals + RR]", overlay=true)
// ----------------------
// Inputs
// ----------------------
atrLen = input.int(14, "ATR Length")
rr = input.float(2.0, "Risk Reward", step=0.25)
confirmBars = input.int(1, "Confirmation Bars")
// ----------------------
// Core Calculations
// ----------------------
atr = ta.atr(atrLen)
// Liquidity levels (simple swing logic)
sellLiquidity = ta.highest(high, 10)
buyLiquidity = ta.lowest(low, 10)
// Sweep detection
sellSweep = high > sellLiquidity[1] and close < sellLiquidity[1]
buySweep = low < buyLiquidity[1] and close > buyLiquidity[1]
// Confirmation candles
bullConfirm = close > open and close > close[1]
bearConfirm = close < open and close < close[1]
// ----------------------
// Trade Logic
// ----------------------
buySignal = buySweep and bullConfirm
sellSignal = sellSweep and bearConfirm
// Risk management
buyStop = low - atr
sellStop = high + atr
buyTarget = close + (close - buyStop) * rr
sellTarget = close - (sellStop - close) * rr
// ----------------------
// Plot Signals
// ----------------------
plotshape(buySignal, title="BUY", style=shape.labelup, text="BUY", color=color.new(color.green, 0))
plotshape(sellSignal, title="SELL", style=shape.labeldown, text="SELL", color=color.new(color.red, 0))
// Stops & Targets
plot(buySignal ? buyStop : na, color=color.red, style=plot.style_linebr)
plot(buySignal ? buyTarget : na, color=color.green, style=plot.style_linebr)
plot(sellSignal ? sellStop : na, color=color.red, style=plot.style_linebr)
plot(sellSignal ? sellTarget : na, color=color.green, style=plot.style_linebr)
// ----------------------
// WAIT State
// ----------------------
waitState = not buySignal and not sellSignal
plotchar(waitState, title="WAIT", char=".", location=location.top, color=color.gray)
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.