Is there anyone who can edit this for the tradingview indicator

my problem is that i can’t get rid of the fractals within the mother candle’s ranges, there are always some still appearing. because I would like that as long as the mother candle is not crossed, its range will be no fractals.

//@version=5 indicator(‘Scooby Fractal with Inside Bar Setup’, shorttitle=’SCOOBY Fractal’, overlay=true, max_boxes_count=500, max_lines_count=500, max_labels_count=500)// Inputs for Swing Points swingSizeR = input.int(1, ‘Bars Right-Left’, inline=’brl’) swingSizeL = input.int(1, ‘-‘, inline=’brl’)// Line style input lineStyleOpt = input.string(title=”Line Style”, defval=”Dotted”, options=[“Solid”, “Dotted”, “Dashed”])// Line width input lineWidth = input.int(title=”Line Width”, defval=1, minval=1, maxval=10)// Line color inputs downFractalColor = input.color(title=”Down Fractal Line Color”, defval=color.green) upFractalColor = input.color(title=”Up Fractal Line Color”, defval=color.red)// Function to get line style getLineStyle(style) => switch style “Solid” => line.style_solid “Dotted” => line.style_dotted “Dashed” => line.style_dashedlineStyle = getLineStyle(lineStyleOpt)// Pivot calculations using swing points pivHi = ta.pivothigh(high, swingSizeL, swingSizeR) pivLo = ta.pivotlow(low, swingSizeL, swingSizeR)// Variables to store fractal lines var levelLines = array.new_line() var levelPrices = array.new_float() var levelColors = array.new_color() var levelCrossed = array.new_bool()// Plot the pivot points as shapes on the chart with color matching the line color plotshape(series=not na(pivHi), style=shape.triangledown, location=location.abovebar, offset=-swingSizeR, color=downFractalColor, transp=25) plotshape(series=not na(pivLo), style=shape.triangleup, location=location.belowbar, offset=-swingSizeR, color=upFractalColor, transp=25)// Inside Bar Setup var inside_bar = array.new_int(0) var inside_bar_high = array.new_float(0) var inside_bar_low = array.new_float(0) var motherCandleHigh = 0.0 var motherCandleLow = 0.0isInside() => previousBar = 1 isInsidePattern = high < high[previousBar] and low > low[previousBar] isInsidePatternnewDay = ta.change(time(‘D’))if newDay array.clear(inside_bar) array.clear(inside_bar_high) array.clear(inside_bar_low)if isInside() and array.size(inside_bar) <= 0 array.push(inside_bar, bar_index) array.push(inside_bar_high, high[1]) array.push(inside_bar_low, low[1])if barstate.islast and array.size(inside_bar) > 0 motherCandleHigh := array.get(inside_bar_high, 0) motherCandleLow := array.get(inside_bar_low, 0)// Function to create and store lines createLine(fractalLevel, fractalBarIndex, color) => ln = line.new(x1=fractalBarIndex, y1=fractalLevel, x2=bar_index, y2=fractalLevel, color=color.new(color, 100), width=lineWidth, style=lineStyle) // Hide line initially array.push(levelLines, ln) array.push(levelPrices, fractalLevel) array.push(levelColors, color) array.push(levelCrossed, false)// Create lines for new swing points if not na(pivHi) and (motherCandleHigh == 0 or (pivHi > motherCandleHigh or pivHi < motherCandleLow)) createLine(pivHi, bar_index[swingSizeR], downFractalColor)if not na(pivLo) and (motherCandleHigh == 0 or (pivLo > motherCandleHigh or pivLo < motherCandleLow)) createLine(pivLo, bar_index[swingSizeR], upFractalColor)// Extend lines once they are crossed size = array.size(levelLines) if size > 0 for i = 0 to size – 1 ln = array.get(levelLines, i) level = array.get(levelPrices, i) crossed = array.get(levelCrossed, i) ln_color = array.get(levelColors, i) if not crossed and high >= level and low <= level line.set_x2(ln, bar_index) line.set_color(ln, ln_color) array.set(levelCrossed, i, true) else if not crossed line.set_x2(ln, bar_index)// Deleting the oldest lines if array is too big maxLines = 500 if array.size(levelLines) >= maxLines int i = 0 while array.size(levelLines) >= maxLines ln = array.get(levelLines, i) line.delete(ln) array.remove(levelLines, i) array.remove(levelPrices, i) array.remove(levelColors, i) array.remove(levelCrossed, i) i += 1

New contributor

Crypto Mark is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật