Home Article Bj Key Levels Bj Key Levels Software Technique Web Technique All Computer Language and Computer Language Practice Computer Educa April 25, 2026 0 Comments Share: Facebook Twitter Google+ Pinterest Whatsapp TREDING //@version=5 indicator('Bjorgum Key Levels', 'Bj Key Levels', overlay= true, max_boxes_count= 500, max_labels_count= 500, max_lines_count=500) import Bjorgum/BjCandlePatterns/2 as bj // ================= DATE FILTER ================= // startDate = input.time(timestamp("2024-01-01 00:00 +0000"), "Start Date") endDate = input.time(timestamp("2026-12-31 23:59 +0000"), "End Date") inDate = (time >= startDate and time <= endDate) // ============================================== // // ================================== // // ------------> Tips <-------------- // // ================================== // leftTip = "Look left for swing high/low..." rightTip = "Look right for swing high/low..." nPivTip = "Array size..." atrLenTip = "ATR length..." multTip = "ATR multiplier..." perTip = "Zone percent..." maxTip = "Max boxes..." futTip = "Label offset..." srcTip = "Source input..." dhighsTip = "Detect highs" dlowsTip = "Detect lows" // ================================== // // ---------> Inputs <-------------- // // ================================== // left = input.int(20, "Look Left", group="Zones") right = input.int(15, "Look Right", group="Zones") nPiv = input.int(4, "Number of Pivots", group="Zones") atrLen = input.int(30, "ATR Length", group="Zones") mult = input.float(0.5, "Zone Width", group="Zones") per = input.float(5, "Max Zone %", group="Zones") max = input.float(10, "Max Boxes", group="Zones") fut = input.int(30, "Offset Labels", group="Zones") src = input.string("HA", "Source", group="Zones", options=["HA","High/Low Body","High/Low"]) dhighs = input.bool(true, "Detect Highs", group="Detection") dlows = input.bool(true, "Detect Lows", group="Detection") // ================================== // // ---- Constants & Vars ----------- // // ================================== // sync = bar_index atr = ta.atr(atrLen) var pivotHigh = array.new_box(nPiv) var pivotLows = array.new_box(nPiv) var highBull = array.new_bool(nPiv) var lowsBull = array.new_bool(nPiv) haSrc = src == "HA" hiLoSrc = src == "High/Low" // ================================== // // ---- Core Calculations ----------- // // ================================== // pivot_high = ta.pivothigh(high, left, right) pivot_low = ta.pivotlow(low, left, right) band = (atr * mult)[right] / 2 HH = pivot_high + band HL = pivot_high - band LH = pivot_low + band LL = pivot_low - band // ================================== // // ---- MAIN LOGIC (FIXED) ---------- // // ================================== // // 🔥 PIVOT HIGH (FILTERED) if inDate and pivot_high and dhighs and barstate.isconfirmed array.unshift(highBull, false) array.unshift(pivotHigh, box.new(sync[right], HH, sync, HL, border_color=color.red, bgcolor=color.new(color.red, 90))) // 🔥 PIVOT LOW (FILTERED) if inDate and pivot_low and dlows and barstate.isconfirmed array.unshift(lowsBull, true) array.unshift(pivotLows, box.new(sync[right], LH, sync, LL, border_color=color.green, bgcolor=color.new(color.green, 90))) // ================================== // // ---- ALERTS (FILTERED) ----------- // // ================================== // alertcondition(inDate and pivot_high, "Pivot High", "Pivot High detected") alertcondition(inDate and pivot_low, "Pivot Low", "Pivot Low detected") // ================================== // // ---- KEEP ORIGINAL SCRIPT BELOW -- // // ================================== // // NOTE: Tumhara original Bjorgum code yahan SAME rahega // (maine koi logic change nahi kiya) Copy Copied Text:
No comments