OPEN-SOURCE SCRIPT
Hopiplaka Goldbach Swings

Core Functionality
Swing Detection: Uses Left and Right Buffer inputs to identify pivot highs and lows using ta.pivothigh() and ta.pivotlow().
Three Reference Points: For every potential swing, it calculates:
Minute: minute(time)
Hour + Minute: hour(time) + minute(time)
|Hour - Minute|: abs(hour(time) - minute(time))
Goldbach/CE Master List: Checks all three references against the master list: 0, 3, 7, 11, 14, 17, 23, 29, 35, 41, 44, 47, 50, 53, 56, 59, 65, 71, 77, 83, 89, 97, 100.
Tolerance: A user-defined tolerance (0 or 1) allows for near-matches.
Display Rules
Conditional Labels: By default, labels only appear if at least one reference point matches a Goldbach number. I've added a toggle to show all swings in gray if you wish to see non-matching pivots.
Color Coding:
Green: Swing High with a Goldbach match.
Red: Swing Low with a Goldbach match.
Gray: Swings with no match (only if "Show All" is enabled).
Inverse Rule (> 60): If a matched Goldbach number is greater than 60, the label displays its complement to 100 (e.g., 89 is displayed as 11). The original reference value (e.g., 89) is still shown for context.
Usage Notes
The script is an overlay, meaning it draws directly on the price chart.
It uses the chart's current timezone to calculate hours and minutes.
You can adjust the Left/Right Buffer to fine-tune the "strength" of the swings (larger buffers result in fewer, more significant pivots)
Swing Detection: Uses Left and Right Buffer inputs to identify pivot highs and lows using ta.pivothigh() and ta.pivotlow().
Three Reference Points: For every potential swing, it calculates:
Minute: minute(time)
Hour + Minute: hour(time) + minute(time)
|Hour - Minute|: abs(hour(time) - minute(time))
Goldbach/CE Master List: Checks all three references against the master list: 0, 3, 7, 11, 14, 17, 23, 29, 35, 41, 44, 47, 50, 53, 56, 59, 65, 71, 77, 83, 89, 97, 100.
Tolerance: A user-defined tolerance (0 or 1) allows for near-matches.
Display Rules
Conditional Labels: By default, labels only appear if at least one reference point matches a Goldbach number. I've added a toggle to show all swings in gray if you wish to see non-matching pivots.
Color Coding:
Green: Swing High with a Goldbach match.
Red: Swing Low with a Goldbach match.
Gray: Swings with no match (only if "Show All" is enabled).
Inverse Rule (> 60): If a matched Goldbach number is greater than 60, the label displays its complement to 100 (e.g., 89 is displayed as 11). The original reference value (e.g., 89) is still shown for context.
Usage Notes
The script is an overlay, meaning it draws directly on the price chart.
It uses the chart's current timezone to calculate hours and minutes.
You can adjust the Left/Right Buffer to fine-tune the "strength" of the swings (larger buffers result in fewer, more significant pivots)
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.