OPEN-SOURCE SCRIPT

Buy/Sell Side Liquidity

//version=5
indicator("Buy/Sell Side Liquidity", overlay=true)

// Parámetros
lookback_high = input.int(20, title="Buscar Máximos (Buy Side)", minval=1)
lookback_low = input.int(20, title="Buscar Mínimos (Sell Side)", minval=1)
show_labels = input.bool(true, title="Mostrar Etiquetas")

// Detectar máximos y mínimos recientes
highest_price = ta.highest(high, lookback_high)
lowest_price = ta.lowest(low, lookback_low)

// Detectar barras donde aparecen los máximos y mínimos
high_bar = ta.highestbars(high, lookback_high)
low_bar = ta.lowestbars(low, lookback_low)

// Dibujar líneas en las zonas de Buy/Sell Side Liquidity
bsl_line = line.new(x1=bar_index - lookback_high, y1=highest_price, x2=bar_index, y2=highest_price, color=color.new(color.blue, 70), width=2, extend=extend.right, style=line.style_dotted)
ssl_line = line.new(x1=bar_index - lookback_low, y1=lowest_price, x2=bar_index, y2=lowest_price, color=color.new(color.red, 70), width=2, extend=extend.right, style=line.style_dotted)

// Etiquetas opcionales para identificar zonas de liquidez
if show_labels
label.new(bar_index[high_bar], highest_price, "BSL", style=label.style_label_down, color=color.blue, textcolor=color.white)
label.new(bar_index[low_bar], lowest_price, "SSL", style=label.style_label_up, color=color.red, textcolor=color.white)
Candlestick analysisChart patternsFundamental Analysis

開源腳本

在真正的TradingView精神中,這個腳本的作者以開源的方式發佈,這樣交易員可以理解和驗證它。請向作者致敬!您可以免費使用它,但在出版物中再次使用這段程式碼將受到網站規則的約束。 您可以收藏它以在圖表上使用。

想在圖表上使用此腳本?

免責聲明