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)
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.