// This work is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0…
- User
// This work is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
// https://creativecommons.org/licenses/by-nc-sa/4.0/ // © BigBeluga//@version=5 indicator("Liquidity Zones [BigBeluga]", overlay = true, max_lines_count = 500)
// ---------------------------------------------------------------------------------------------------------------------} // INPUTS --------------------------------------------------------------------------------------------------------------{
int leftBars = input.int(10, "Length") int rightBars = leftBars -2 int qty_pivots = input.int(10, "Zones Amount", minval = 1, maxval = 50) string flt = input.string("Mid", "Volume Strength Filter", options = ["Low", "Mid", "High"], tooltip = "Filtering Pivots By Volume Strength") bool dynamic = input.bool(false, "Dynamic Distance", group = "Mode", tooltip = "Dynamic Distance from Pivots based on Volume Strength") bool hidePivot = input.bool(true, "Filtered Pivots")
// Color definitions color upper_col = input.color(#2370a3, "Upper", group = "Liquidity Color", inline = "L") // Blue color lower_col = input.color(#23a372, "Lower", group = "Liquidity Color", inline = "L") // Green
// Arrays to store lines and boxes var line[] lines = array.new()
var box [] boxes = array.new()// ---------------------------------------------------------------------------------------------------------------------} // CALCULATIONS --------------------------------------------------------------------------------------------------------{ // Volume Filter filter = (flt == "Low" ? 1 : flt == "Mid" ? 2 : flt == "High" ? 3 : 0) // Calculate pivot high and low series float ph = ta.pivothigh(leftBars, rightBars) series float pl = ta.pivotlow(leftBars, rightBars)
// Calculate average volume and normalize it float avg_vol = ta.sma(volume, rightBars) // avg volume on 5 bars float normalized_vol = (avg_vol-0) / ta.stdev(avg_vol, 500)
// Calculate color intensity based on normalized volume int color_intense = math.round(normalized_vol)*15 color_intense := color_intense > 100 ? 100 : color_intense
// Calculate Average True Range float aTR = ta.atr(200)
// Function to extend lines and update boxes extend_line(lineArray, boxes) => if lineArray.size() > 0 and last_bar_index-bar_index < 1500 for i = lineArray.size() - 1 to 0 by 1 x2 = line.get_x2(array.get(lineArray, i)) yValue = line.get_y1(array.get(lineArray, i))
if bar_index == x2 and not(high > yValue and low < yValue) line.set_x2(lineArray.get(i), bar_index+1) if (high > yValue and low < yValue) line.set_style(lineArray.get(i), line.style_dashed) line.set_width(lineArray.get(i), 1) box.set_text(boxes.get(i), "Liquidity\nGrabbed") box.set_border_width(boxes.get(i), 1) box.set_bgcolor(boxes.get(i), na) lineArray.set(i, line(na)) label.new( bar_index, yValue, "〇", color = color(na), style = label.style_label_center, textcolor = #df1c1c, tooltip = "Claim Liquidity Point" ) - Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.