OPEN-SOURCE SCRIPT
GoldenCube HMA Flow

This indicator builds a six‑line HMA system from a single base integer you enter. Each subsequent HMA period is generated by multiplying the previous period by φ³ ≈ 4.23606797749979 and rounding. The six HMAs are plotted on the chart, colored by slope, and grouped into three pairs with filled areas and an optional alignment alert.
Sequence Generation
Input: one integer called Base number (example: 55).
Sequence rule: next = round(previous × φ³).
Example: .
The script computes these six integer lengths automatically and uses them as HMA periods.
HMA Calculation and Timeframe Handling
Standard HMA: each HMA is on the chart timeframe.
Large-length handling: if HMA length > 5000 and the chart is intraday, the indicator computes that HMA on a timeframe that is 3× the current intraday period (for example 1m → 3m) using , then brings that higher‑TF HMA back onto the current chart. This avoids impractical minute‑level smoothing for extremely large periods.
Visuals and Coloring
Per-line coloring: each HMA line is colored green when its slope (current value − previous bar value) is non‑negative and red when negative.
Plots: six HMA lines are plotted with fixed titles (HMA 1 … HMA 6).
Label: a status label on the last bar shows the six lengths and each group’s bullish/bearish state.
Group Logic and Alerts
Groups: HMAs are paired into three groups — Group 1 = HMA1 & HMA2, Group 2 = HMA3 & HMA4, Group 3 = HMA5 & HMA6.
Bull/Bear definition: a group is bullish when the first HMA in the pair is above the second, bearish otherwise.
Fills: the area between each pair is filled green when bullish and red when bearish; fill colors are configurable.
Alignment alert: an input toggle enables an alert condition that fires when Group 2 and Group 3 share the same trend direction (both bullish or both bearish). The script defines the alert condition; TradingView’s Alerts dialog is used to create notifications.
Sequence Generation
Input: one integer called Base number (example: 55).
Sequence rule: next = round(previous × φ³).
Example: .
The script computes these six integer lengths automatically and uses them as HMA periods.
HMA Calculation and Timeframe Handling
Standard HMA: each HMA is on the chart timeframe.
Large-length handling: if HMA length > 5000 and the chart is intraday, the indicator computes that HMA on a timeframe that is 3× the current intraday period (for example 1m → 3m) using , then brings that higher‑TF HMA back onto the current chart. This avoids impractical minute‑level smoothing for extremely large periods.
Visuals and Coloring
Per-line coloring: each HMA line is colored green when its slope (current value − previous bar value) is non‑negative and red when negative.
Plots: six HMA lines are plotted with fixed titles (HMA 1 … HMA 6).
Label: a status label on the last bar shows the six lengths and each group’s bullish/bearish state.
Group Logic and Alerts
Groups: HMAs are paired into three groups — Group 1 = HMA1 & HMA2, Group 2 = HMA3 & HMA4, Group 3 = HMA5 & HMA6.
Bull/Bear definition: a group is bullish when the first HMA in the pair is above the second, bearish otherwise.
Fills: the area between each pair is filled green when bullish and red when bearish; fill colors are configurable.
Alignment alert: an input toggle enables an alert condition that fires when Group 2 and Group 3 share the same trend direction (both bullish or both bearish). The script defines the alert condition; TradingView’s Alerts dialog is used to create notifications.
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 la 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 o de otro tipo proporcionadas o respaldadas por TradingView. 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 la 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 o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.