//@version=6 // ===================================================================================== // FUSED — SwingTargets (v1_8) + MTF Manipulation Candle & Zone Detector (v24.1) // v2 CHANGES vs v1 (settings/panel only — no detection, drawing, or break logic touched): // - SwingTargets' colour-legend table removed entirely (inputs showLegend/legendPos // and the table.new() block) — one less thing drawing on the chart, and one less // settings group. // - Per-TF settings from BOTH engines are now unified: one "TF — 1m" / "TF — 5m" / // etc. group holds SwingTargets' rows AND the MC/Zone Detector's row for that same // timeframe, placed together at the very top of Settings. Previously they sat in // two separate blocks ("SwingTargets — 1m" then, much further down, "MC Zones — // 1m"), so finding everything for one TF meant scrolling and cross-referencing. // - Within each unified group, the per-TF "Enable" checkboxes are now labelled // "Enable (Swings)" and "Enable (Zones)" so the two engines' toggles aren't // visually identical once they sit side by side. // Phase 1 (this build's foundation) is still: both engines byte-for-byte identical in // LOGIC to their original scripts — nothing added, removed, or changed in what either // engine detects, draws, or breaks on. The v2 edits above are purely settings-panel // organisation and one cosmetic feature removal (the legend), both done at your request. // Mechanical renames carried over from v1, to let both engines share one script without // name clashes: every identifier that existed in BOTH originals (inputs, functions, draw // arrays) was prefixed — st_ for SwingTargets, mz_ for the MC/Zone Detector — e.g. // boxOpacity -> st_boxOpacity / mz_boxOpacity, proc() -> st_proc()/mz_proc(). chartMin // and the invisible "scale_anchor" price-lock plot (identical in both originals) are // each declared ONCE and shared. calc_bars_count=0 is inherited from the MC/Zone // Detector (it needs max loaded history to anchor higher-TF zones) — this also extends // how much history SwingTargets sees, strictly more data, nothing removed. // NOT included in this build: zone-overlap/confluence marking, swing sweep-vs-break // marking, or the AMC label — all deferred, on purpose, to a later version. // ===================================================================================== indicator("SwingTargets + MC Zones — Fused v2", overlay=true, max_lines_count=500, max_boxes_count=500, max_labels_count=500, calc_bars_count=0) // invisible plot: locks the indicator to the chart's price scale (shared by both engines; // was identical and duplicated in both originals, kept once here). plot(close, "scale_anchor", color=color.new(color.gray, 100)) // ===================================================================================== // TIMEFRAME SETTINGS — everything for a given TF (both engines) lives in one place here. // "Enable (Swings)" + the rows under it = SwingTargets on that TF. // "Enable (Zones)" + "Zones" = the MC/Zone Detector on that TF. // ===================================================================================== st_en0=input.bool(true,"Enable (Swings)",group="TF — 1m",inline="a"), sw0=input.bool(true,"Show swings",group="TF — 1m",inline="a"), bx0=input.bool(true,"Show boxes",group="TF — 1m",inline="a") ea0=input.int(2,"Ext above",minval=0,group="TF — 1m",inline="b"), eb0=input.int(2,"Ext below",minval=0,group="TF — 1m",inline="b") ia0=input.int(2,"Int above",minval=0,group="TF — 1m",inline="c"), ib0=input.int(2,"Int below",minval=0,group="TF — 1m",inline="c") ec0=input.color(color.gray,"Ext colour",group="TF — 1m",inline="d"), ic0=input.color(color.silver,"Int colour",group="TF — 1m",inline="d") fe0=input.bool(true,"Show FVGs",group="TF — 1m",inline="e"), fc0=input.color(color.gray,"FVG colour",group="TF — 1m",inline="e") fa0=input.int(1,"FVG above",minval=0,group="TF — 1m",inline="f"), fb0=input.int(1,"FVG below",minval=0,group="TF — 1m",inline="f") mz_en0=input.bool(true,"Enable (Zones)",group="TF — 1m",inline="g"), z0=input.bool(false,"Zones",group="TF — 1m",inline="g") st_en1=input.bool(true,"Enable (Swings)",group="TF — 5m",inline="a"), sw1=input.bool(true,"Show swings",group="TF — 5m",inline="a"), bx1=input.bool(true,"Show boxes",group="TF — 5m",inline="a") ea1=input.int(2,"Ext above",minval=0,group="TF — 5m",inline="b"), eb1=input.int(2,"Ext below",minval=0,group="TF — 5m",inline="b") ia1=input.int(2,"Int above",minval=0,group="TF — 5m",inline="c"), ib1=input.int(2,"Int below",minval=0,group="TF — 5m",inline="c") ec1=input.color(color.blue,"Ext colour",group="TF — 5m",inline="d"), ic1=input.color(color.aqua,"Int colour",group="TF — 5m",inline="d") fe1=input.bool(true,"Show FVGs",group="TF — 5m",inline="e"), fc1=input.color(color.blue,"FVG colour",group="TF — 5m",inline="e") fa1=input.int(1,"FVG above",minval=0,group="TF — 5m",inline="f"), fb1=input.int(1,"FVG below",minval=0,group="TF — 5m",inline="f") mz_en1=input.bool(true,"Enable (Zones)",group="TF — 5m",inline="g"), z1=input.bool(true,"Zones",group="TF — 5m",inline="g") st_en2=input.bool(true,"Enable (Swings)",group="TF — 15m",inline="a"), sw2=input.bool(true,"Show swings",group="TF — 15m",inline="a"), bx2=input.bool(true,"Show boxes",group="TF — 15m",inline="a") ea2=input.int(2,"Ext above",minval=0,group="TF — 15m",inline="b"), eb2=input.int(2,"Ext below",minval=0,group="TF — 15m",inline="b") ia2=input.int(2,"Int above",minval=0,group="TF — 15m",inline="c"), ib2=input.int(2,"Int below",minval=0,group="TF — 15m",inline="c") ec2=input.color(color.teal,"Ext colour",group="TF — 15m",inline="d"), ic2=input.color(color.green,"Int colour",group="TF — 15m",inline="d") fe2=input.bool(true,"Show FVGs",group="TF — 15m",inline="e"), fc2=input.color(color.teal,"FVG colour",group="TF — 15m",inline="e") fa2=input.int(1,"FVG above",minval=0,group="TF — 15m",inline="f"), fb2=input.int(1,"FVG below",minval=0,group="TF — 15m",inline="f") mz_en2=input.bool(true,"Enable (Zones)",group="TF — 15m",inline="g"), z2=input.bool(false,"Zones",group="TF — 15m",inline="g") mz_en3=input.bool(true,"Enable (Zones)",group="TF — 30m",inline="g"), z3=input.bool(false,"Zones",group="TF — 30m",inline="g") st_en3=input.bool(true,"Enable (Swings)",group="TF — 1h",inline="a"), sw3=input.bool(true,"Show swings",group="TF — 1h",inline="a"), bx3=input.bool(true,"Show boxes",group="TF — 1h",inline="a") ea3=input.int(2,"Ext above",minval=0,group="TF — 1h",inline="b"), eb3=input.int(2,"Ext below",minval=0,group="TF — 1h",inline="b") ia3=input.int(2,"Int above",minval=0,group="TF — 1h",inline="c"), ib3=input.int(2,"Int below",minval=0,group="TF — 1h",inline="c") ec3=input.color(color.orange,"Ext colour",group="TF — 1h",inline="d"), ic3=input.color(color.yellow,"Int colour",group="TF — 1h",inline="d") fe3=input.bool(true,"Show FVGs",group="TF — 1h",inline="e"), fc3=input.color(color.orange,"FVG colour",group="TF — 1h",inline="e") fa3=input.int(1,"FVG above",minval=0,group="TF — 1h",inline="f"), fb3=input.int(1,"FVG below",minval=0,group="TF — 1h",inline="f") mz_en4=input.bool(true,"Enable (Zones)",group="TF — 1h",inline="g"), z4=input.bool(true,"Zones",group="TF — 1h",inline="g") st_en4=input.bool(true,"Enable (Swings)",group="TF — 4h",inline="a"), sw4=input.bool(true,"Show swings",group="TF — 4h",inline="a"), bx4=input.bool(true,"Show boxes",group="TF — 4h",inline="a") ea4=input.int(2,"Ext above",minval=0,group="TF — 4h",inline="b"), eb4=input.int(2,"Ext below",minval=0,group="TF — 4h",inline="b") ia4=input.int(2,"Int above",minval=0,group="TF — 4h",inline="c"), ib4=input.int(2,"Int below",minval=0,group="TF — 4h",inline="c") ec4=input.color(#ff6600,"Ext colour",group="TF — 4h",inline="d"), ic4=input.color(#ffaa66,"Int colour",group="TF — 4h",inline="d") fe4=input.bool(true,"Show FVGs",group="TF — 4h",inline="e"), fc4=input.color(#ff6600,"FVG colour",group="TF — 4h",inline="e") fa4=input.int(1,"FVG above",minval=0,group="TF — 4h",inline="f"), fb4=input.int(1,"FVG below",minval=0,group="TF — 4h",inline="f") mz_en5=input.bool(true,"Enable (Zones)",group="TF — 4h",inline="g"), z5=input.bool(true,"Zones",group="TF — 4h",inline="g") st_en5=input.bool(true,"Enable (Swings)",group="TF — Daily",inline="a"), sw5=input.bool(true,"Show swings",group="TF — Daily",inline="a"), bx5=input.bool(true,"Show boxes",group="TF — Daily",inline="a") ea5=input.int(2,"Ext above",minval=0,group="TF — Daily",inline="b"), eb5=input.int(2,"Ext below",minval=0,group="TF — Daily",inline="b") ia5=input.int(2,"Int above",minval=0,group="TF — Daily",inline="c"), ib5=input.int(2,"Int below",minval=0,group="TF — Daily",inline="c") ec5=input.color(color.red,"Ext colour",group="TF — Daily",inline="d"), ic5=input.color(#ff9999,"Int colour",group="TF — Daily",inline="d") fe5=input.bool(true,"Show FVGs",group="TF — Daily",inline="e"), fc5=input.color(color.red,"FVG colour",group="TF — Daily",inline="e") fa5=input.int(1,"FVG above",minval=0,group="TF — Daily",inline="f"), fb5=input.int(1,"FVG below",minval=0,group="TF — Daily",inline="f") mz_en6=input.bool(true,"Enable (Zones)",group="TF — Daily",inline="g"), z6=input.bool(true,"Zones",group="TF — Daily",inline="g") // ===================================================================================== // ENGINE 1 — SWINGTARGETS (st_ prefix on every identifier that used to collide) // ===================================================================================== // ===================================================================================== // SwingTargets - Pine v1_8 (TradingView port of NinjaScript v10's feature set) // NEW vs v1_6: per-TF "Show swings" toggle (swOf) — swings and FVGs are now independent // siblings under the master per-TF "Enable". Lets you run FVG-only on any // timeframe (e.g. 15m FVGs on a 5m chart with no 15m swings). // NEW vs v1_7: FVG mitigation is now a 3-way choice (First touch / Full fill / Body // close) defaulting to Full fill. The old "Wick touch" default broke every // FVG on the first touch of its NEAR edge, so FVGs were detected and then // instantly marked broken -> nothing ever drew. Also: FVGs default ON, // "showBroken" is finally wired up (diagnostic), and the self-break // immunity guard now spans the whole 3-candle pattern. // // PORTS: per-TF swings (internal/external), lines + wick boxes, break vs sweep // (selectable), nearest-N per side per TF, min-1, per-TF FVGs, labels, // colour-legend table, per-TF colours & counts, current TF and above. // NOT PORTED: deep history (Pine = loaded chart bars only), bias engine. // ===================================================================================== // invisible plot: locks this indicator to the chart's PRICE scale so all lines/boxes // track the candles when you pan/scroll (fixes "frozen drawings on a separate scale"). // Transparent colour = invisible, but it still anchors the scale (do NOT use display.none). // ---------------- global inputs ---------------- extLen = input.int(5, "External strength", minval=1, group="Detection") intLen = input.int(2, "Internal strength", minval=1, group="Detection") swBreakWick = input.string("Full body close", "Swing break", options=["Full body close","Wick touch"], group="Detection") == "Wick touch" // FVG mitigation: "First touch" = dies when price touches the NEAR edge (old v1_7 // behaviour, extremely trigger-happy). "Full fill" = dies only once the gap is fully // closed. "Body close" = dies when a body closes clean through it. fvgMode = input.string("Full fill", "FVG mitigation", options=["First touch","Full fill","Body close"], group="Detection") showLines = input.bool(true, "Show lines", group="Display") showBroken = input.bool(false, "Show broken zones", group="Display") distinguish = input.bool(true, "Distinguish internal/external", group="Display") guaranteeMin = input.bool(true, "Guarantee min 1 per side", group="Display") showLabels = input.bool(true, "Show labels", group="Display") labelPlusType = input.string("TF + type","Label style", options=["TF + type","TF only"], group="Display") == "TF + type" st_labelStackT = input.int(10, "Label stack tolerance (ticks)", minval=1, group="Display") st_labelStep = input.int(4, "Label horizontal step (bars)", minval=1, group="Display") lineW = input.int(2, "Line width", minval=1, maxval=4, group="Display") st_boxOpacity = input.int(18, "Box opacity (0-100)", minval=0, maxval=100, group="Display") // ---------------- per-TF inputs (inlined; Pine requires const args) ---------------- // "Enable" = master switch for this TF (nothing at all if off) // "Show swings" = swing lines/boxes/labels for this TF // "Show FVGs" = FVG boxes/labels for this TF <- independent of "Show swings" // ---------------- ladder accessors ---------------- st_tfMin(i) => i==0?1 : i==1?5 : i==2?15 : i==3?60 : i==4?240 : 1440 st_tfName(i) => i==0?"1m": i==1?"5m": i==2?"15m": i==3?"1h": i==4?"4h":"D" st_enOf(i) => i==0?st_en0:i==1?st_en1:i==2?st_en2:i==3?st_en3:i==4?st_en4:st_en5 swOf(i) => i==0?sw0:i==1?sw1:i==2?sw2:i==3?sw3:i==4?sw4:sw5 bxOf(i) => i==0?bx0:i==1?bx1:i==2?bx2:i==3?bx3:i==4?bx4:bx5 eaOf(i) => i==0?ea0:i==1?ea1:i==2?ea2:i==3?ea3:i==4?ea4:ea5 ebOf(i) => i==0?eb0:i==1?eb1:i==2?eb2:i==3?eb3:i==4?eb4:eb5 iaOf(i) => i==0?ia0:i==1?ia1:i==2?ia2:i==3?ia3:i==4?ia4:ia5 ibOf(i) => i==0?ib0:i==1?ib1:i==2?ib2:i==3?ib3:i==4?ib4:ib5 ecOf(i) => i==0?ec0:i==1?ec1:i==2?ec2:i==3?ec3:i==4?ec4:ec5 icOf(i) => i==0?ic0:i==1?ic1:i==2?ic2:i==3?ic3:i==4?ic4:ic5 feOf(i) => i==0?fe0:i==1?fe1:i==2?fe2:i==3?fe3:i==4?fe4:fe5 faOf(i) => i==0?fa0:i==1?fa1:i==2?fa2:i==3?fa3:i==4?fa4:fa5 fbOf(i) => i==0?fb0:i==1?fb1:i==2?fb2:i==3?fb3:i==4?fb4:fb5 fcOf(i) => i==0?fc0:i==1?fc1:i==2?fc2:i==3?fc3:i==4?fc4:fc5 chartMin = timeframe.in_seconds(timeframe.period) / 60 st_activeTF(i) => st_tfMin(i) >= chartMin and st_enOf(i) // ---------------- types ---------------- type Swing int tf float extreme float bodyEdge int t bool isHigh bool isExt bool broken int breakT type Fvg int tf float lo float hi int t bool isBull bool broken int breakT var array swings = array.new() var array fvgs = array.new() // ---------------- per-TF data via one security call each (confirmed) ---------------- st_f_tf() => phi = ta.pivothigh(intLen, intLen) pli = ta.pivotlow(intLen, intLen) phe = ta.pivothigh(extLen, extLen) ple = ta.pivotlow(extLen, extLen) beHiI = math.max(open[intLen], close[intLen]) beLoI = math.min(open[intLen], close[intLen]) tiI = time[intLen] beHiE = math.max(open[extLen], close[extLen]) beLoE = math.min(open[extLen], close[extLen]) tiE = time[extLen] cC = close[1] cH = high[1] cL = low[1] bull = high[3] < low[1] bear = low[3] > high[1] fLo = bull ? high[3] : bear ? high[1] : na fHi = bull ? low[1] : bear ? low[3] : na fT = time[2] [phi, pli, phe, ple, beHiI, beLoI, tiI, beHiE, beLoE, tiE, cC, cH, cL, bull, bear, fLo, fHi, fT] [a0_phi,a0_pli,a0_phe,a0_ple,a0_beHiI,a0_beLoI,a0_tiI,a0_beHiE,a0_beLoE,a0_tiE,a0_cC,a0_cH,a0_cL,a0_bull,a0_bear,a0_fLo,a0_fHi,a0_fT] = request.security(syminfo.tickerid, "1", st_f_tf(), lookahead=barmerge.lookahead_off) [a1_phi,a1_pli,a1_phe,a1_ple,a1_beHiI,a1_beLoI,a1_tiI,a1_beHiE,a1_beLoE,a1_tiE,a1_cC,a1_cH,a1_cL,a1_bull,a1_bear,a1_fLo,a1_fHi,a1_fT] = request.security(syminfo.tickerid, "5", st_f_tf(), lookahead=barmerge.lookahead_off) [a2_phi,a2_pli,a2_phe,a2_ple,a2_beHiI,a2_beLoI,a2_tiI,a2_beHiE,a2_beLoE,a2_tiE,a2_cC,a2_cH,a2_cL,a2_bull,a2_bear,a2_fLo,a2_fHi,a2_fT] = request.security(syminfo.tickerid, "15", st_f_tf(), lookahead=barmerge.lookahead_off) [a3_phi,a3_pli,a3_phe,a3_ple,a3_beHiI,a3_beLoI,a3_tiI,a3_beHiE,a3_beLoE,a3_tiE,a3_cC,a3_cH,a3_cL,a3_bull,a3_bear,a3_fLo,a3_fHi,a3_fT] = request.security(syminfo.tickerid, "60", st_f_tf(), lookahead=barmerge.lookahead_off) [a4_phi,a4_pli,a4_phe,a4_ple,a4_beHiI,a4_beLoI,a4_tiI,a4_beHiE,a4_beLoE,a4_tiE,a4_cC,a4_cH,a4_cL,a4_bull,a4_bear,a4_fLo,a4_fHi,a4_fT] = request.security(syminfo.tickerid, "240", st_f_tf(), lookahead=barmerge.lookahead_off) [a5_phi,a5_pli,a5_phe,a5_ple,a5_beHiI,a5_beLoI,a5_tiI,a5_beHiE,a5_beLoE,a5_tiE,a5_cC,a5_cH,a5_cL,a5_bull,a5_bear,a5_fLo,a5_fHi,a5_fT] = request.security(syminfo.tickerid, "D", st_f_tf(), lookahead=barmerge.lookahead_off) // process each TF only when ITS htf bar changes (handle each htf bar once, not on every // chart bar) -> prevents higher-TF zones from re-checking stale data and self-breaking st_new0 = ta.change(time("1")) != 0 st_new1 = ta.change(time("5")) != 0 st_new2 = ta.change(time("15")) != 0 st_new3 = ta.change(time("60")) != 0 st_new4 = ta.change(time("240")) != 0 st_new5 = ta.change(time("D")) != 0 // ---------------- add / break helpers ---------------- addSwing(tf, extreme, bodyEdge, t, isHigh, isExt) => handled = false if array.size(swings) > 0 for i = 0 to array.size(swings)-1 s = array.get(swings, i) if s.tf==tf and s.t==t and s.isHigh==isHigh if isExt and not s.isExt s.isExt := true handled := true break if not handled and not na(extreme) array.push(swings, Swing.new(tf, extreme, bodyEdge, t, isHigh, isExt, false, na)) addFvg(tf, lo, hi, t, isBull) => handled = false if array.size(fvgs) > 0 for i = 0 to array.size(fvgs)-1 f = array.get(fvgs, i) if f.tf==tf and f.t==t handled := true break if not handled and not na(lo) and not na(hi) array.push(fvgs, Fvg.new(tf, lo, hi, t, isBull, false, na)) swingBroke(isHigh, extreme, hi, lo, cl) => swBreakWick ? (isHigh ? hi >= extreme : lo <= extreme) : (isHigh ? cl > extreme : cl < extreme) fvgBroke(isBull, lo, hi, h, l, c) => r = false if fvgMode == "First touch" r := isBull ? l <= hi : h >= lo // near edge else if fvgMode == "Full fill" r := isBull ? l <= lo : h >= hi // far edge - gap fully closed else r := isBull ? c < lo : c > hi // body through it r st_proc(tf, isNew, phi,pli,phe,ple, beHiI,beLoI,tiI, beHiE,beLoE,tiE, cC,cH,cL, bull,bear,fLo,fHi,fT) => if st_activeTF(tf) and isNew // ADD newly formed zones once per htf bar (using htf data). Break-checking is NOT // done here anymore — it happens every CHART bar against chart price (see below), // so a higher-TF zone dies when the candle in front of you breaks it, not only on // a close of its own timeframe. (cC/cH/cL kept in the signature but unused now.) // swOf(tf) / feOf(tf) gate ingestion: a TF with swings off never grows the swing // array, so FVG-only mode costs nothing in break-check work. if swOf(tf) and not na(phi) addSwing(tf, phi, beHiI, tiI, true, false) if swOf(tf) and not na(pli) addSwing(tf, pli, beLoI, tiI, false, false) if swOf(tf) and not na(phe) addSwing(tf, phe, beHiE, tiE, true, true) if swOf(tf) and not na(ple) addSwing(tf, ple, beLoE, tiE, false, true) if feOf(tf) and bull addFvg(tf, fLo, fHi, fT, true) if feOf(tf) and bear addFvg(tf, fLo, fHi, fT, false) st_proc(0, st_new0, a0_phi,a0_pli,a0_phe,a0_ple, a0_beHiI,a0_beLoI,a0_tiI, a0_beHiE,a0_beLoE,a0_tiE, a0_cC,a0_cH,a0_cL, a0_bull,a0_bear,a0_fLo,a0_fHi,a0_fT) st_proc(1, st_new1, a1_phi,a1_pli,a1_phe,a1_ple, a1_beHiI,a1_beLoI,a1_tiI, a1_beHiE,a1_beLoE,a1_tiE, a1_cC,a1_cH,a1_cL, a1_bull,a1_bear,a1_fLo,a1_fHi,a1_fT) st_proc(2, st_new2, a2_phi,a2_pli,a2_phe,a2_ple, a2_beHiI,a2_beLoI,a2_tiI, a2_beHiE,a2_beLoE,a2_tiE, a2_cC,a2_cH,a2_cL, a2_bull,a2_bear,a2_fLo,a2_fHi,a2_fT) st_proc(3, st_new3, a3_phi,a3_pli,a3_phe,a3_ple, a3_beHiI,a3_beLoI,a3_tiI, a3_beHiE,a3_beLoE,a3_tiE, a3_cC,a3_cH,a3_cL, a3_bull,a3_bear,a3_fLo,a3_fHi,a3_fT) st_proc(4, st_new4, a4_phi,a4_pli,a4_phe,a4_ple, a4_beHiI,a4_beLoI,a4_tiI, a4_beHiE,a4_beLoE,a4_tiE, a4_cC,a4_cH,a4_cL, a4_bull,a4_bear,a4_fLo,a4_fHi,a4_fT) st_proc(5, st_new5, a5_phi,a5_pli,a5_phe,a5_ple, a5_beHiI,a5_beLoI,a5_tiI, a5_beHiE,a5_beLoE,a5_tiE, a5_cC,a5_cH,a5_cL, a5_bull,a5_bear,a5_fLo,a5_fHi,a5_fT) // ---- break-check EVERY zone against the CHART's own price, every chart bar ---- // This is the fix: a 4h zone breaks when the 1h candle in front of you breaks it (wick // or body per mode), instead of waiting for a 4h close. Per-zone guard `time >= t + one // htf bar` skips the zone's own formation bar so it can't instant-break itself. // >>> To make higher-TF body-close breaks wait for a true higher-TF close instead of a // chart close, this is the line to change. As-is: chart price counts (reactive). if array.size(swings) > 0 for i = 0 to array.size(swings)-1 s = array.get(swings, i) if not s.broken and time >= s.t + st_tfMin(s.tf)*60000 and swingBroke(s.isHigh, s.extreme, high, low, close) s.broken := true s.breakT := time if array.size(fvgs) > 0 for i = 0 to array.size(fvgs)-1 f = array.get(fvgs, i) if not f.broken and time > f.t + 2*st_tfMin(f.tf)*60000 and fvgBroke(f.isBull, f.lo, f.hi, high, low, close) f.broken := true f.breakT := time // ---------------- draw ---------------- var array st_dLines = array.new() var array st_dBoxes = array.new() var array