پرامپت نقدینگی:
//@version=5
indicator("Liquidity Zones for Gold", overlay=true)
// Input parameters
lookback = input.int(10, title="Lookback Period", minval=1)
threshold = input.float(1.0, title="Price Threshold (%)", minval=0.1, step=0.1)
// Detect swing highs and lows
swing_high = ta.pivothigh(high, lookback, lookback)
swing_low = ta.pivotlow(low, lookback, lookback)
// Variables for zones
var float zone_high = na
var float zone_low = na
var bool draw_zone = false
// Set zones when highs/lows are detected
if not na(swing_high)
zone_high := swing_high
draw_zone := true
if not na(swing_low)
zone_low := swing_low
draw_zone := true
// Draw boxes for liquidity zones
if draw_zone and not na(zone_high)
box.new(left=bar_index[lookback], top=zone_high * (1 + threshold/100), right=bar_index, bottom=zone_high * (1 - threshold/100), bgcolor=color.new(color.red, 80), border_color=color.red)
if draw_zone and not na(zone_low)
box.new(left=bar_index[lookback], top=zone_low * (1 + threshold/100), right=bar_index, bottom=zone_low * (1 - threshold/100), bgcolor=color.new(color.green, 80), border_color=color.green)
// Add labels for highs and lows
if not na(swing_high)
label.new(bar_index[lookback], swing_high, "High Liquidity", color=color.red, style=label.style_label_down, textcolor=color.white)
if not na(swing_low)
label.new(bar_index[lookback], swing_low, "Low Liquidity", color=color.green, style=label.style_label_up, textcolor=color.white)