PROTECTED SOURCE SCRIPT

Order Block & Liquidity Sweep Scalping

//version=6
indicator("Order Block & Liquidity Sweep Scalping", overlay=true)

// Input Parameters
orderBlockLength = input.int(5, "Order Block Length", minval=1) // Length of consolidation to detect order blocks
showLiquidityLevels = input.bool(true, "Show Liquidity Levels")

// Define Highs and Lows for Order Block
highs = ta.highest(high, orderBlockLength)
lows = ta.lowest(low, orderBlockLength)

// Detect Potential Order Blocks
isOrderBlockBullish = (ta.valuewhen(high == highs, close, 0) < high) and ta.valuewhen(high == highs, close, 1) > high
isOrderBlockBearish = (ta.valuewhen(low == lows, close, 0) > low) and ta.valuewhen(low == lows, close, 1) < low

// Draw Order Block Zones
var line bullishOBZone = na
var line bearishOBZone = na

if isOrderBlockBullish
bullishOBZone := line.new(x1=bar_index[0], y1=lows, x2=bar_index[1], y2=lows, color=color.green, width=2)
line.new(x1=bar_index[0], y1=highs, x2=bar_index[1], y2=highs, color=color.green, width=1, style=line.style_dotted)

if isOrderBlockBearish
bearishOBZone := line.new(x1=bar_index[0], y1=highs, x2=bar_index[1], y2=highs, color=color.red, width=2)
line.new(x1=bar_index[0], y1=lows, x2=bar_index[1], y2=lows, color=color.red, width=1, style=line.style_dotted)

// Highlight Liquidity Sweeps
liquiditySweepBullish = showLiquidityLevels and low < ta.lowest(low, orderBlockLength) and close > ta.highest(high, orderBlockLength)
liquiditySweepBearish = showLiquidityLevels and high > ta.highest(high, orderBlockLength) and close < ta.lowest(low, orderBlockLength)

// Plot liquidity sweep signals
plotshape(series=liquiditySweepBullish, title="Bullish Liquidity Sweep", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)
plotshape(series=liquiditySweepBearish, title="Bearish Liquidity Sweep", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small)

// Strategy Alerts
alertcondition(liquiditySweepBullish, title="Bullish Liquidity Sweep Alert", message="Bullish Liquidity Sweep detected")
alertcondition(liquiditySweepBearish, title="Bearish Liquidity Sweep Alert", message="Bearish Liquidity Sweep detected")
Chart patterns

סקריפט מוגן

סקריפט זה פורסם במקור סגור ותוכל להשתמש בו באופן חופשי. אתה יכול להגדירו כמועדף כדי להשתמש בו בגרף. אינך יכול להציג או לשנות את קוד המקור שלו.

רוצה להשתמש בסקריפ זה בגרף?

כתב ויתור