Indicator · Pine Script v6 · On the chart

Goldbach Times - Clean Quant Suite

by kkgenai1846

This indicator overlays time-based structural analysis tools directly on the main price chart using a customizable Zurich timezone anchor.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code373
Settings20inputs
LicenceMIT
Last update3 weeks ago29 Oct 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

373 lines of Pine Script v6 from Goldbach_Time_PO3_v6.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

Goldbach_Time_PO3_v6.pine
//@version=6
indicator("Goldbach Times - Clean Quant Suite [v6]", 
          shorttitle="GB Clean Suite [v6]", 
          overlay=true, 
          max_lines_count=500, 
          max_boxes_count=500, 
          max_labels_count=500)

// =============================================================================
// 1. ARCHITECTURE & USER PREFERENCES
// =============================================================================
var string G_TIME  = "1. Interbank Time Engine (Zurich UTC+1)"
i_tz               = input.string("UTC+1", "Timezone Anchor", options=["UTC+1", "UTC+0", "America/New_York"], group=G_TIME)
i_show_bg_nodes    = input.bool(true, "Subtle Column Fill on Prime Nodes", group=G_TIME)
i_bg_color         = input.color(color.new(#FFD600, 92), "Prime Node Fill Color", group=G_TIME)

var string G_SWING = "2. Anti-Collision Swing Clock Analyzer"
i_enable_swings    = input.bool(true, "Enable Swing Node Markers", group=G_SWING)
i_only_gb_swings   = input.bool(true, "Filter: ONLY Mark Swings on Prime Nodes (Declutter)", group=G_SWING, tooltip="Hides normal swings and only displays pivots that align mathematically with Goldbach Time.")
i_pivot_len        = input.int(3, "Pivot Detection Sensitivity", minval=1, maxval=15, group=G_SWING)
i_show_csd_rays    = input.bool(true, "Plot Change in State of Delivery (CSD) Rays", group=G_SWING)

var string G_FVG   = "3. Institutional Imbalance (FVG & 50% CE)"
i_enable_fvg       = input.bool(true, "Plot Unmitigated FVGs", group=G_FVG)
i_fvg_max          = input.int(6, "Max Active FVGs (Prevents Clutter)", minval=1, maxval=20, group=G_FVG)
i_col_bull_fvg     = input.color(color.new(#00E676, 88), "Bullish FVG Fill", group=G_FVG)
i_col_bear_fvg     = input.color(color.new(#FF1744, 88), "Bearish FVG Fill", group=G_FVG)
i_col_ce_line      = input.color(#FFD600, "50% CE Midpoint Line", group=G_FVG)

var string G_PO3   = "4. Projected Hopiplaka PO3 (81-Grid)"
i_enable_po3       = input.bool(true, "Project PO3 Dealing Ranges", group=G_PO3)
i_po3_future_only  = input.bool(true, "Project Strictly into Future Space (Zero Candle Clutter)", group=G_PO3)
i_grid_size        = input.float(81.0, "Dealing Grid Size (Points/Pips)", step=9.0, group=G_PO3)
i_proj_offset      = input.int(20, "Future Projection Distance (Bars)", minval=10, maxval=60, group=G_PO3)
i_col_po3_bound    = input.color(color.new(#3D5AFE, 40), "Outer Dealing Rail", group=G_PO3)
i_col_po3_ce       = input.color(color.new(#FFD600, 30), "PO3 50% CE Baseline", group=G_PO3)

var string G_HUD   = "5. Heads-Up Terminal Display (HUD)"
i_show_hud         = input.bool(true, "Show Minimal HUD Dashboard", group=G_HUD)
i_hud_position     = input.string("Top Right", "HUD Screen Position", options=["Top Right", "Bottom Right", "Top Left", "Bottom Left"], group=G_HUD)

// =============================================================================
// 2. TIME ENGINE & GOLDBACH PRIME AUDIT
// =============================================================================
int c_min = minute(time, i_tz)
int c_hr  = hour(time, i_tz)

// Primary 7 Partitions (Sum to 100): 3, 11, 17, 29, 41, 47, 53, 59
bool is_gb_prime = (c_min == 3  or c_min == 11 or c_min == 17 or 
                    c_min == 29 or c_min == 41 or c_min == 47 or 
                    c_min == 53 or c_min == 59)

// Secondary Harmonic Expansion Nodes: 7, 13, 19, 23, 31, 37, 43
bool is_gb_harmonic = (c_min == 7  or c_min == 13 or c_min == 19 or 
                       c_min == 23 or c_min == 31 or c_min == 37 or 
                       c_min == 43)

// Clock Arithmetic
int hh_plus_mm  = c_hr + c_min
int hh_minus_mm = math.abs(c_hr - c_min)

// Ultra-subtle vertical column highlight (zero text collision)
bgcolor(i_show_bg_nodes and is_gb_prime ? i_bg_color : na, title="Prime Node Column Highlight")

// =============================================================================
// 3. CLEAN SWING NODE ANALYZER (ANTI-COLLISION)
// =============================================================================
float p_high = ta.pivothigh(high, i_pivot_len, i_pivot_len)
float p_low  = ta.pivotlow(low, i_pivot_len, i_pivot_len)

type CsdRay
    line  ray_line
    float level
    bool  is_high
    bool  active

var CsdRay[] csd_rays = array.new<CsdRay>()

// Clean up stale CSD lines
f_clean_csd() =>
    if array.size(csd_rays) > 10
        CsdRay stale = array.shift(csd_rays)
        line.delete(stale.ray_line)

if i_enable_swings
    // Pivot High Evaluation
    if not na(p_high)
        int sw_min = minute(time[i_pivot_len], i_tz)
        int sw_hr  = hour(time[i_pivot_len], i_tz)
        bool sw_is_prime = (sw_min == 3 or sw_min == 11 or sw_min == 17 or sw_min == 29 or sw_min == 41 or sw_min == 47 or sw_min == 53 or sw_min == 59)
        
        if not i_only_gb_swings or sw_is_prime
            int sw_bar = bar_index - i_pivot_len
            string tag_h = str.tostring(sw_hr) + ":" + (sw_min < 10 ? "0" : "") + str.tostring(sw_min) + 
                           (sw_is_prime ? " ★" : "")
            
            // Clean badge floating safely above candle wicks
            label.new(sw_bar, p_high, text=tag_h, 
                      yloc=yloc.abovebar, 
                      color=sw_is_prime ? color.new(#FF1744, 20) : color.new(#2A2E39, 40), 
                      textcolor=color.white, 
                      style=label.style_label_down, 
                      size=size.tiny)

            if i_show_csd_rays
                line csd_l = line.new(sw_bar, p_high, bar_index + 5, p_high, 
                                      color=color.new(#FF5252, 60), 
                                      style=line.style_dashed, 
                                      width=1)
                array.push(csd_rays, CsdRay.new(csd_l, p_high, true, true))
                f_clean_csd()

    // Pivot Low Evaluation
    if not na(p_low)
        int sw_min = minute(time[i_pivot_len], i_tz)
        int sw_hr  = hour(time[i_pivot_len], i_tz)
        bool sw_is_prime = (sw_min == 3 or sw_min == 11 or sw_min == 17 or sw_min == 29 or sw_min == 41 or sw_min == 47 or sw_min == 53 or sw_min == 59)
        
        if not i_only_gb_swings or sw_is_prime
            int sw_bar = bar_index - i_pivot_len
            string tag_l = str.tostring(sw_hr) + ":" + (sw_min < 10 ? "0" : "") + str.tostring(sw_min) + 
                           (sw_is_prime ? " ★" : "")
            
            // Clean badge floating safely below candle wicks
            label.new(sw_bar, p_low, text=tag_l, 
                      yloc=yloc.belowbar, 
                      color=sw_is_prime ? color.new(#00E676, 20) : color.new(#2A2E39, 40), 
                      textcolor=color.white, 
                      style=label.style_label_up, 
                      size=size.tiny)

            if i_show_csd_rays
                line csd_l = line.new(sw_bar, p_low, bar_index + 5, p_low, 
                                      color=color.new(#00E676, 60), 
                                      style=line.style_dashed, 
                                      width=1)
                array.push(csd_rays, CsdRay.new(csd_l, p_low, false, true))
                f_clean_csd()

// Extend active CSD lines forward without cluttering past bars
if array.size(csd_rays) > 0
    for i = 0 to array.size(csd_rays) - 1
        CsdRay r = array.get(csd_rays, i)
        if r.active
            if (r.is_high and close > r.level) or (not r.is_high and close < r.level)
                line.set_x2(r.ray_line, bar_index)
                r.active := false
            else
                line.set_x2(r.ray_line, bar_index + 4)

// =============================================================================
// 4. CLEAN FVG & 50% CE ENGINE (CONFINED GEOMETRY)
// =============================================================================
type FvgNode
    box   gap_box
    line  ce_line
    float top
    float btm
    float ce
    bool  is_bull

var FvgNode[] fvg_pool = array.new<FvgNode>()

f_clean_fvgs() =>
    while array.size(fvg_pool) > i_fvg_max
        FvgNode drop_fvg = array.shift(fvg_pool)
        box.delete(drop_fvg.gap_box)
        line.delete(drop_fvg.ce_line)

if i_enable_fvg
    // Bullish FVG
    if (low > high[2]) and (close[1] > open[1])
        float top_val = low
        float btm_val = high[2]
        float ce_val  = (top_val + btm_val) / 2.0
        
        box bx = box.new(bar_index - 2, top_val, bar_index + 8, btm_val, 
                         border_color=color.new(#00E676, 60), 
                         bgcolor=i_col_bull_fvg)
        
        line ln = line.new(bar_index - 2, ce_val, bar_index + 8, ce_val, 
                           color=i_col_ce_line, 
                           style=line.style_dotted, 
                           width=1)
        
        array.push(fvg_pool, FvgNode.new(bx, ln, top_val, btm_val, ce_val, true))
        f_clean_fvgs()

    // Bearish FVG
    if (high < low[2]) and (close[1] < open[1])
        float top_val = low[2]
        float btm_val = high
        float ce_val  = (top_val + btm_val) / 2.0
        
        box bx = box.new(bar_index - 2, top_val, bar_index + 8, btm_val, 
                         border_color=color.new(#FF1744, 60), 
                         bgcolor=i_col_bear_fvg)
        
        line ln = line.new(bar_index - 2, ce_val, bar_index + 8, ce_val, 
                           color=i_col_ce_line, 
                           style=line.style_dotted, 
                           width=1)
        
        array.push(fvg_pool, FvgNode.new(bx, ln, top_val, btm_val, ce_val, false))
        f_clean_fvgs()

    // Track mitigations cleanly
    if array.size(fvg_pool) > 0
        for idx = array.size(fvg_pool) - 1 to 0
            FvgNode f = array.get(fvg_pool, idx)
            bool mitigated = (f.is_bull and low <= f.btm) or (not f.is_bull and high >= f.top)
            
            if mitigated
                box.delete(f.gap_box)
                line.delete(f.ce_line)
                array.remove(fvg_pool, idx)
            else
                box.set_right(f.gap_box, bar_index + 4)
                line.set_x2(f.ce_line, bar_index + 4)

// =============================================================================
// 5. PROJECTED PO3 81-GRID (CLEAN FUTURE-ONLY PROJECTION)
// =============================================================================
var line[]  po3_lines  = array.new<line>()
var label[] po3_labels = array.new<label>()
var box[]   po3_boxes  = array.new<box>()

f_clear_po3_render() =>
    if array.size(po3_lines) > 0
        for i = 0 to array.size(po3_lines) - 1
            line.delete(array.get(po3_lines, i))
        array.clear(po3_lines)
    if array.size(po3_labels) > 0
        for i = 0 to array.size(po3_labels) - 1
            label.delete(array.get(po3_labels, i))
        array.clear(po3_labels)
    if array.size(po3_boxes) > 0
        for i = 0 to array.size(po3_boxes) - 1
            box.delete(array.get(po3_boxes, i))
        array.clear(po3_boxes)

if i_enable_po3 and barstate.islast
    f_clear_po3_render()
    
    // Calculate Anchor
    float grid_base = math.floor(close / i_grid_size) * i_grid_size
    
    // Future Space Projection Coordinates
    int start_x = i_po3_future_only ? bar_index + 2 : bar_index - 40
    int end_x   = bar_index + i_proj_offset

    // Draw Primary Dealing Range Bracket
    for offset = 0 to 1
        float lvl_base = grid_base + (offset * i_grid_size)
        float lvl_top  = lvl_base + i_grid_size
        float lvl_ce   = lvl_base + (i_grid_size * 0.5)

        // Outer Range Rail
        line l_top = line.new(start_x, lvl_top, end_x, lvl_top, color=i_col_po3_bound, style=line.style_solid, width=1)
        array.push(po3_lines, l_top)

        // 50% Consequent Encroachment (Golden Dotted)
        line l_ce = line.new(start_x, lvl_ce, end_x, lvl_ce, color=i_col_po3_ce, style=line.style_dotted, width=1)
        array.push(po3_lines, l_ce)

        // Right-Aligned Crisp Price Level Badges (Zero Candle Collision)
        label lb_top = label.new(end_x, lvl_top, text="PO3 ERD [" + str.tostring(lvl_top, "#.##") + "]", 
                                 color=color.new(color.black, 100), 
                                 textcolor=i_col_po3_bound, 
                                 style=label.style_label_left, 
                                 size=size.tiny)
        array.push(po3_labels, lb_top)

        label lb_ce = label.new(end_x, lvl_ce, text="PO3 50% CE [" + str.tostring(lvl_ce, "#.##") + "]", 
                                color=color.new(color.black, 100), 
                                textcolor=color.new(#FFD600, 10), 
                                style=label.style_label_left, 
                                size=size.tiny)
        array.push(po3_labels, lb_ce)

    // Baseline Boundary
    line l_bot = line.new(start_x, grid_base, end_x, grid_base, color=i_col_po3_bound, style=line.style_solid, width=1)
    array.push(po3_lines, l_bot)

    label lb_bot = label.new(end_x, grid_base, text="PO3 Base [" + str.tostring(grid_base, "#.##") + "]", 
                             color=color.new(color.black, 100), 
                             textcolor=i_col_po3_bound, 
                             style=label.style_label_left, 
                             size=size.tiny)
    array.push(po3_labels, lb_bot)

    // Projected 11% Manipulation Pocket
    float sweep_zone = grid_base - (i_grid_size * 0.11)
    box b_manip = box.new(start_x, grid_base, end_x, sweep_zone, 
                          border_color=color.new(#FF3D00, 80), 
                          bgcolor=color.new(#FF3D00, 92))
    array.push(po3_boxes, b_manip)
    
    label lb_swp = label.new(end_x, sweep_zone, text="11% Stop Run Pocket", 
                             color=color.new(color.black, 100), 
                             textcolor=color.new(#FF3D00, 20), 
                             style=label.style_label_left, 
                             size=size.tiny)
    array.push(po3_labels, lb_swp)

// =============================================================================
// 6. GLASSMORPHIC COMPACT HUD TERMINAL
// =============================================================================
var table hud_term = table.new(position.top_right, 2, 5, 
                               bgcolor=color.new(#070A11, 25), 
                               border_color=color.new(#3D5AFE, 60), 
                               border_width=1, 
                               frame_color=color.new(#3D5AFE, 40), 
                               frame_width=1)

f_convert_hud_pos(string pos_text) =>
    switch pos_text
        "Top Left"      => position.top_left
        "Bottom Left"   => position.bottom_left
        "Bottom Right"  => position.bottom_right
        => position.top_right

f_calc_next_prime(int m_current) =>
    int[] p_nodes = array.new<int>()
    array.push(p_nodes, 3)
    array.push(p_nodes, 11)
    array.push(p_nodes, 17)
    array.push(p_nodes, 29)
    array.push(p_nodes, 41)
    array.push(p_nodes, 47)
    array.push(p_nodes, 53)
    array.push(p_nodes, 59)
    
    int target = 63
    for k = 0 to array.size(p_nodes) - 1
        int n_val = array.get(p_nodes, k)
        if n_val > m_current
            target := n_val
            break
            
    int countdown = (target == 63) ? (60 - m_current + 3) : (target - m_current)
    countdown

if i_show_hud and barstate.islast
    table.set_position(hud_term, f_convert_hud_pos(i_hud_position))
    
    // Row 0: Title Bar
    table.cell(hud_term, 0, 0, "GOLDBACH QUANT", bgcolor=color.new(#3D5AFE, 30), text_color=color.white, text_size=size.small)
    table.cell(hud_term, 1, 0, "v6 PRO", bgcolor=color.new(#3D5AFE, 30), text_color=#FFD600, text_size=size.small)

    // Row 1: Interbank Clock
    string clock_readout = (c_hr < 10 ? "0" : "") + str.tostring(c_hr) + ":" + 
                           (c_min < 10 ? "0" : "") + str.tostring(c_min) + " " + i_tz
    table.cell(hud_term, 0, 1, "Interbank Clock", text_color=color.gray, text_size=size.tiny)
    table.cell(hud_term, 1, 1, clock_readout, text_color=color.white, text_size=size.tiny)

    // Row 2: Status
    string status_lbl = is_gb_prime ? "ACTIVE PRIME NODE" : (is_gb_harmonic ? "Harmonic Window" : "Consolidation Drift")
    color  status_col = is_gb_prime ? #FFD600 : (is_gb_harmonic ? #00E676 : color.gray)
    table.cell(hud_term, 0, 2, "Temporal Window", text_color=color.gray, text_size=size.tiny)
    table.cell(hud_term, 1, 2, status_lbl, text_color=status_col, text_size=size.tiny)

    // Row 3: Next Node Countdown
    int left_mins = f_calc_next_prime(c_min)
    table.cell(hud_term, 0, 3, "Next Prime Node", text_color=color.gray, text_size=size.tiny)
    table.cell(hud_term, 1, 3, str.tostring(left_mins) + " min(s)", text_color=#00E5FF, text_size=size.tiny)

    // Row 4: Dealing Range Trajectory
    float base_pt = math.floor(close / i_grid_size) * i_grid_size
    float pct_pos = ((close - base_pt) / i_grid_size) * 100.0
    string phase_name = (pct_pos < 12.0) ? "Accumulation / Stop Sweep" : (pct_pos > 75.0 ? "Terminal Distribution" : "Expansion Run")
    table.cell(hud_term, 0, 4, "PO3 Phase", text_color=color.gray, text_size=size.tiny)
    table.cell(hud_term, 1, 4, phase_name + " [" + str.tostring(pct_pos, "#.#") + "%]", text_color=#FFAB00, text_size=size.tiny)

Overview

Goldbach Times - Clean Quant Suite identifies minute-level temporal prime nodes, plots pivot swings, and draws change in state of delivery rays. Additionally, it detects active unmitigated fair value gaps with 50% midpoint lines, projects customizable 81-point dealing ranges into future chart space, and displays operational status in a minimal heads-up display dashboard.

Details

Published by

kkgenai1846 on GitHub

Draws

On the price chart

Markets

Forex, Indices

Timeframes

M1-M5, M15-H1

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Topics

algorithmic-tradinggoldbach-timehopiplaka-po3ict-tradingpine-scriptpine-script-v6time-and-pricetradingviewtradingview-indicator

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Timezone AnchorstringUTC+1i_tz
Subtle Column Fill on Prime Nodesbooltruei_show_bg_nodes
Prime Node Fill Colorcolorcolor.new(#FFD600, 92)i_bg_color
Enable Swing Node Markersbooltruei_enable_swings
Filter: ONLY Mark Swings on Prime Nodes (Declutter)booltruei_only_gb_swings
Pivot Detection Sensitivityint3i_pivot_len
Plot Change in State of Delivery (CSD) Raysbooltruei_show_csd_rays
Plot Unmitigated FVGsbooltruei_enable_fvg
Max Active FVGs (Prevents Clutter)int6i_fvg_max
Bullish FVG Fillcolorcolor.new(#00E676, 88)i_col_bull_fvg
Bearish FVG Fillcolorcolor.new(#FF1744, 88)i_col_bear_fvg
50% CE Midpoint Linecolor#FFD600i_col_ce_line
Show all 20 settings
SettingTypeDefaultVariable
Project PO3 Dealing Rangesbooltruei_enable_po3
Project Strictly into Future Space (Zero Candle Clutter)booltruei_po3_future_only
Dealing Grid Size (Points/Pips)float81.0i_grid_size
Future Projection Distance (Bars)int20i_proj_offset
Outer Dealing Railcolorcolor.new(#3D5AFE, 40)i_col_po3_bound
PO3 50% CE Baselinecolorcolor.new(#FFD600, 30)i_col_po3_ce
Show Minimal HUD Dashboardbooltruei_show_hud
HUD Screen PositionstringTop Righti_hud_position
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

Golden Bullet Strategy

by TradersPost
228 stars

The Golden Bullet Strategy is an overlay signal indicator based on Smart Money Concepts and time-based liquidity models. It identifies liquidity sweeps of a designated reference session range during a specified hunt window. It then confirms Market Structure Sh

Indicator v6 SMC / ICT / price actionSessions & time
Updated 4 months ago · None stated GitHub repository of Golden Bullet Strategy

This indicator detects and draws the first Fair Value Gap (FVG) that forms in each hourly session based on a selected lower timeframe, with specialized handling for Regular Trading Hours (RTH) confluence windows. It draws FVG range boxes, midpoint lines, hourl

Indicator v5 SMC / ICT / price actionSupport & resistance Repaints

Clusterbreak

by Jferheart
15 stars

This indicator identifies Break of Structure (BOS) and Market Structure Shift (MSS) zones, plotting automated bracket levels on the price chart. It triggers signals when a reversal breaks a swing point formed inside an opposing zone, projecting stop loss and t

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 7 weeks ago · None stated GitHub repository of Clusterbreak

MyTTFM - Clean

by dbruce1990
13 stars

MyTTFM - Clean draws a higher-timeframe candle overlay on the price chart and marks related ICT fractal structure. It plots configurable HTF candles, period separator lines, midpoint levels, a T-Spot box, and labels for recent C2 and C3 patterns plus swept lev

Indicator v6 SMC / ICT / price actionSupport & resistance
Updated 1 year ago · None stated GitHub repository of MyTTFM - Clean
10 stars

This overlay indicator researches multi-timeframe setup zones for NQ and ES futures on the price chart. It builds chart, five-minute through four-hour zones, including transformed IFVG and BB zones, scores them, and tracks liquidity pools and structure. During

Indicator v6 Support & resistanceSMC / ICT / price action Repaints
Updated 2 months ago · MPL-2.0 GitHub repository of Meridian - Futures Setups Research

Apex Protocol Assistant

by alboogycOdR
6 stars

Apex Protocol Assistant is a Smart Money Concepts indicator designed for session-based trading. It determines market direction using a higher timeframe Exponential Moving Average and highlights Asian range boundaries alongside London and New York killzones. Th

Indicator v5 SMC / ICT / price actionSessions & time
Updated 8 months ago · None stated GitHub repository of Apex Protocol Assistant

More SMC / ICT scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers