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)
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.