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精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受网站规则约束。 您可以收藏它以在图表上使用。

想在图表上使用此脚本?

免责声明