OPEN-SOURCE SCRIPT

Fibonacci Circle Zones

1 553
🟩 The Fibonacci Circle Zones indicator is a technical visualization tool, building upon the concept of traditional Fibonacci circles. It provides configurable options for analyzing geometric relationships between price and time, used to identify potential support and resistance zones derived from circle-based projections. The indicator constructs these Fibonacci circles based on two user-selected anchor points (Point A and Point B), which define the foundational price range and time duration for the geometric analysis.

Key features include multiple mathematical Circle Formulas for radius scaling and several options for defining the circle's center point, enabling exploration of complex, non-linear geometric relationships between price and time distinct from traditional linear Fibonacci analysis. Available formulas incorporate various mathematical constants (π, e, φ variants, Silver Ratio) alongside traditional Fibonacci ratios, facilitating investigation into different scaling hypotheses. Furthermore, selecting the Center point relative to the A-B anchors allows these circular time-price patterns to be constructed and analyzed from different geometric perspectives. Analysis can be further tailored through detailed customization of up to 12 Fibonacci levels, including their mathematical values, colors, and visibility..
istantanea

📚 THEORY and CONCEPT 📚

Fibonacci circles represent an application of Fibonacci principles within technical analysis, extending beyond typical horizontal price levels by incorporating the dimension of time. These geometric constructions traditionally use numerical proportions, often derived from the Fibonacci sequence, to project potential zones of price-time interaction, such as support or resistance. A theoretical understanding of such geometric tools involves considering several core components: the significance of the chosen geometric origin or center point, the mathematical principles governing the proportional scaling of successive radii, and the fundamental calculation considerations (like chart scale adjustments and base radius definitions) that influence the resulting geometry and ensure its accurate representation.
istantanea

Circle Center

The traditional construction methodology for Fibonacci circles begins with the selection of two significant anchor points on the chart, usually representing a key price swing, such as a swing low (Point A) and a subsequent swing high (Point B), or vice versa. This defined segment establishes the primary vector—representing both the price range and the time duration of that specific market move. From these two points, a base distance or radius is derived (this calculation can vary, sometimes using the vertical price distance, the time duration, or the diagonal distance). A center point for the circles is then typically established, often at the midpoint (time and price) between points A and B, or sometimes anchored directly at point B.

Concentric circles are then projected outwards from this center point. The radii of these successive circles are calculated by multiplying the base distance by key Fibonacci ratios and other standard proportions. The underlying concept posits that markets may exhibit harmonic relationships or cyclical behavior that adheres to these proportions, suggesting these expanding geometric zones could highlight areas where future price movements might decelerate, reverse, or find equilibrium, reflecting a potential proportional resonance with the initial defining swing in both price and time.

The Fibonacci Circle Zones indicator enhances traditional Fibonacci circle construction by offering greater analytical depth and flexibility: it addresses the origin point of the circles: instead of being limited to common definitions like the midpoint or endpoint B, this indicator provides a selection of distinct center point calculations relative to the initial A-B swing. The underlying idea is that the geometric source from which harmonic projections emanate might vary depending on the market structure being analyzed. This flexibility allows for experimentation with different center points (derived algorithmically from the A, B, and midpoint coordinates), facilitating exploration of how price interacts with circular zones anchored from various perspectives within the defining swing.

istantanea
Potential Center Points Setup: This view shows the anchor points A and B, defined by the user, which form the basis of the calculations. The indicator dynamically calculates various potential Center points (C through N, and X) based on the A-B structure, representing different geometric origins available for selection in the settings.


Point X holds particular significance as it represents the calculated midpoint (in both time and price) between A and B. This 'X' point corresponds to the default 'Auto' center setting upon initial application of the indicator and aligns with the centering logic used in TradingView's standard Fibonacci Circle tool, offering a familiar starting point.

The other potential center points allow for exploring circles originating from different geometric anchors relative to the A-B structure. While detailing the precise calculation for each is beyond the scope of this overview, they can be broadly categorized: points C through H are derived from relationships primarily within the A-B time/price range, whereas points I through N represent centers projected beyond point B, extrapolating the A-B geometry. Point J, for example, is calculated as a reflection of the A-X midpoint projected beyond B. This variety provides a rich set of options for analyzing circle patterns originating from historical, midpoint, and extrapolated future anchor perspectives.

istantanea
Default Settings (Center X, FibCircle): Using the default Center X (calculated midpoint) with the default FibCircle. Although circles begin plotting only after Point B is established, their curvature shows they are geometrically centered on X. This configuration matches the standard TradingView Fib Circle tool, providing a baseline.


istantanea
Centering on Endpoint B: Using Point B, the user-defined end of the swing, as the Center. This anchors the circular projections directly to the swing's termination point. Unlike centering on the midpoint (X) or start point (A), this focuses the analysis on geometric expansion originating precisely from the conclusion of the measured A-B move.


istantanea
Projected Center J: Using the projected Point J as the Center. Its position is calculated based on the A-B swing (conceptually, it represents a forward projection related to the A-X midpoint relationship) and is located chronologically beyond Point B. This type of forward projection often allows complete circles to be visualized as price develops into the corresponding time zone.


istantanea
Time Symmetry Projection (Center L): Uses the projected Point L as the Center. It is located at the price level of the start point (A), projected forward in time from B by the full duration of the A-B swing. This perspective focuses analysis on temporal symmetry, exploring geometric expansions from a point representing a full time cycle completion anchored back at the swing's origin price level.


Circle Formula

Beyond the center point, the expansion of the projected circles is determined by the selected Circle Formula. This setting provides different mathematical methods, or scaling options, for scaling the circle radii. Each option applies a distinct mathematical constant or relationship to the base radius derived from the A-B swing, allowing for exploration of various geometric proportions.

eScaled
  • Mathematical Basis: Scales the radius by Euler's number (e ≈ 2.718), the base of natural logarithms. This constant appears frequently in processes involving continuous growth or decay.
  • Enables investigation of market geometry scaled by e, exploring relationships potentially based on natural exponential growth applied to time-price circles, potentially relevant for analyzing phases of accelerating momentum or volatility expansion.

FibCircle
  • Mathematical Basis: Scales the radius to align with TradingView’s built-in Fibonacci Circle Tool.
  • Provides a baseline circle size, potentially emulating scaling used in standard drawing tools, serving as a reference point for comparison with other options.

GoldenFib
  • Mathematical Basis: Scales the radius by the Golden Ratio (φ ≈ 1.618).
  • Explores the fundamental Golden Ratio proportion, central to Fibonacci analysis, applied directly to circular time-price geometry, potentially highlighting zones reflecting harmonic expansion or retracement patterns often associated with φ.

GoldenContour
  • Mathematical Basis: Scales the radius by a factor derived from Golden Ratio geometry (√(1 + φ²) / 2 ≈ 0.951). It represents a specific geometric relationship derived from φ.
  • Allows analysis using proportions linked to the geometry of the Golden Rectangle, scaled to produce circles very close to the initial base radius. This explores structural relationships often associated with natural balance or proportionality observed in Golden Ratio constructions.

SilverRatio
  • Mathematical Basis: Scales the radius by the Silver Ratio (1 + √2 ≈ 2.414). The Silver Ratio governs relationships in specific regular polygons and recursive sequences.
  • Allows exploration using the proportions of the Silver Ratio, offering a significant expansion factor based on another fundamental metallic mean for comparison with φ-based methods.

PhiDecay
  • Mathematical Basis: Scales the radius by φ raised to the power of -φ (φ⁻ᵠ ≈ 0.53). This unique exponentiation explores a less common, non-linear transformation involving φ.
  • Explores market geometry scaled by this specific phi-derived factor which is significantly less than 1.0, offering a distinct contractile proportion for analysis, potentially relevant for identifying zones related to consolidation phases or decaying momentum.

PhiSquared
  • Mathematical Basis: Scales the radius by φ squared, normalized by dividing by 3 (φ² / 3 ≈ 0.873).
  • Enables investigation of patterns related to the φ² relationship (a key Fibonacci extension concept), visualized at a scale just below 1.0 due to normalization. This scaling explores projections commonly associated with significant trend extension targets in linear Fibonacci analysis, adapted here for circular geometry.

PiScaled
  • Mathematical Basis: Scales the radius by Pi (π ≈ 3.141).
  • Explores direct scaling by the fundamental circle constant (π), investigating proportions inherent to circular geometry within the market's time-price structure, potentially highlighting areas related to natural market cycles, rotational symmetry, or full-cycle completions.

PlasticNumber
  • Mathematical Basis: Scales the radius by the Plastic Number (approx 1.3247), the third metallic mean. Like φ and the Silver Ratio, it is the solution to a specific cubic equation and relates to certain geometric forms.
  • Introduces another distinct fundamental mathematical constant for geometric exploration, comparing market proportions to those potentially governed by the Plastic Number.

SilverFib
  • Mathematical Basis: Scales the radius by the reciprocal Golden Ratio (1/φ ≈ 0.618).
  • Explores proportions directly related to the core 0.618 Fibonacci ratio, fundamental within Fibonacci-based geometric analysis, often significant for identifying primary retracement levels or corrective wave structures within a trend.

Unscaled
  • Mathematical Basis: No scaling applied.
  • Provides the base circle defined by points A/B and the Center setting without any additional mathematical scaling, serving as a pure geometric reference based on the A-B structure.


🧪 Advanced Calculation Settings

Two advanced settings allow further refinement of the circle calculations: matching the chart's scale and defining how the base radius is calculated from the A-B swing.

The Chart Scale setting ensures geometric accuracy by aligning circle calculations with the chart's vertical axis display. Price charts can use either a standard (linear) or logarithmic scale, where vertical distances represent price changes differently. The setting offers two options:
  • Standard: Select this option when the price chart's vertical axis is set to a standard linear scale.
  • Logarithmic: It is necessary to select this option if the price chart's vertical axis is set to a logarithmic scale. Doing so ensures the indicator adjusts its calculations to maintain correct geometric proportions relative to the visual price action on the log-scaled chart.


The Radius Calc setting determines how the fundamental base radius is derived from the A-B swing, offering two primary options:
  • Auto: This is the default setting and represents the traditional method for radius calculation. This method bases the radius calculation on the vertical price range of the A-B swing, focusing the geometry on the price amplitude.
  • Geometric: This setting provides an alternative calculation method, determining the base radius from the diagonal distance between Point A and Point B. It considers both the price change and the time duration relative to the chart's aspect ratio, defining the radius based on the overall magnitude of the A-B price-time vector.

This choice allows the resulting circle geometry to be based either purely on the swing's vertical price range (Auto) or on its combined price-time movement (Geometric).


🖼️ CHART EXAMPLES 🖼️

istantanea
Default Behavior (X Center, FibCircle Formula): This configuration uses the midpoint (Center X) and the FibCircle scaling Formula, representing the indicator's effective default setup when 'Auto' is selected for both options initially. This is designed to match the output of the standard TradingView Fibonacci Circle drawing tool.


istantanea
Center B with Unscaled Formula: This example shows the indicator applied to an uptrend with the Center set to Point B and the Circle Formula set to Unscaled. This configuration projects the defined levels (0.236, 0.382, etc.) as arcs originating directly from the swing's termination point (B) without applying any additional mathematical scaling from the formulas.


istantanea
Visualization with Projected Center J: Here, circles are centered on the projected point J, calculated from the A-B structure but located forward in time from point B. Notice how using this forward-projected origin allows complete inner circles to be drawn once price action develops into that zone, providing a distinct visual representation of the expanding geometric field compared to using earlier anchor points. (Unscaled formula used in this example).


istantanea
PhiSquared Scaling from Endpoint B: The PhiSquared scaling Formula applied from the user-defined swing endpoint (Point B). Radii expand based on a normalized relationship with φ² (the square of the Golden Ratio), creating a unique geometric structure and spacing between the circle levels compared to other formulas like Unscaled or GoldenFib.


istantanea
Centering on Swing Origin (Point A): Illustrates using Point A, the user-defined start of the swing, as the circle Center. Note the significantly larger scale and wider spacing of the resulting circles. This difference occurs because centering on the swing's origin (A) typically leads to a larger base radius calculation compared to using the midpoint (X) or endpoint (B). (Unscaled formula used).


istantanea
Center Point D: Point D, dynamically calculated from the A-B swing, is used as the origin (Center=D). It is specifically located at the price level of the swing's start point (A) occurring precisely at the time coordinate of the swing's end point (B). This offers a unique perspective, anchoring the geometric expansion to the initial price level at the exact moment the defining swing concludes. (Unscaled formula shown).


istantanea
Center Point G: Point G, also dynamically calculated from the A-B swing, is used as the origin (Center=G). It is located at the price level of the swing's endpoint (B) occurring at the time coordinate of the start point (A). This provides the complementary perspective to Point D, anchoring the geometric expansion to the final price level achieved but originating from the moment the swing began. As observed in the example, using Point G typically results in very wide circle projections due to its position relative to the core A-B action. (Unscaled formula shown).


istantanea
Center Point I: Half-Duration Projection: Using the dynamically calculated Point I as the Center. Located at Point B's price level but projected forward in time by half the A-B swing duration, Point I's calculated time coordinate often falls outside the initially visible chart area. As the chart progresses, this origin point will appear, revealing large, sweeping arcs representing geometric expansions based on a half-cycle temporal projection from the swing's endpoint price. (Unscaled formula shown).


istantanea
Center Point M: Point M, also dynamically calculated from the A-B swing, serves as the origin (Center=M). It combines the midpoint price level (derived from X) with a time coordinate projected forward from Point B by the full duration of the A-B swing. This perspective anchors the geometric expansion to the swing's balance price level but originates from the completion point of a full temporal cycle relative to the A-B move. Like other projected centers, using M allows for complete circles to be visualized as price progresses into its time zone. (SilverFib formula shown).


istantanea
Geometric Validation & Functionality: Comparing the indicator (red lines), using its default settings (Center X, FibCircle Formula), against TradingView's standard Fib Circle tool (green lines/white background). The precise alignment, particularly visible at the 1.50 and 2.00 levels shown, validates the core geometry calculation.



🛠️ CONFIGURATION AND SETTINGS 🛠️

The Fibonacci Circle Zones indicator offers a range of configurable settings to tailor its functionality and visual representation. These options allow customization of the circle origin, scaling method, level visibility, visual appearance, and input points.

Center and Formula
istantanea
Settings for selecting the circle origin and scaling method.
  • Center: Dropdown menu to select the origin point for the circles.
    Auto: Automatically uses point X (the calculated midpoint between A and B).
    Selectable points including start/end (A, B), midpoint (X), plus various points derived from or projected beyond the A-B swing (C-N).
  • Circle Formula: Dropdown menu to select the mathematical method for scaling circle radii.
    • Auto: Automatically selects a default formula ('FibCircle' if Center is 'X', 'Unscaled' otherwise).
    • Includes standard Fibonacci scaling (FibCircle, GoldenFib), other mathematical constants (PiScaled, eScaled), metallic means (SilverRatio), phi transformations (PhiDecay, PhiSquared), and others.


Fib Levels
istantanea
Configuration options for the 12 individual Fibonacci levels.


Advanced Settings
istantanea
Settings related to core calculation methods.
  • Radius Calc: Defines how the base radius is calculated (e.g., 'Auto' for vertical price range, 'Geometric' for diagonal price-time distance).
  • Chart Scale: Aligns circle calculations with the chart's vertical axis setting ('Standard' or 'Logarithmic') for accurate visual proportions.


Visual Settings
istantanea
Settings controlling the visual display of the indicator elements.
  • Plots: Dropdown controlling which parts of the calculated circles are displayed (Upper, All, or Lower).
  • Labels: Dropdown controlling the display of the numerical level value labels (All, Left, Right, or None).
  • Setup: Dropdown controlling the visibility of the initial setup graphics (Show or Hide).
  • Info: Dropdown controlling the visibility of the small information table (Show or Hide).
  • Text Size: Adjusts the font size for all text elements displayed by the indicator (Value ranges from 0 to 36).
  • Line Width: Adjusts the width of the circle plots (1-10).


Time/Price
istantanea
Inputs for the anchor points defining the base swing.
These settings define the start (Point A) and end (Point B) of the price swing used for all calculations.
  • Point A (Time, Price): Input fields for the exact time coordinate and price level of the swing's starting point (A).
  • Point B (Time, Price): Input fields for the exact time coordinate and price level of the swing's ending point (B).
  • Interactive Adjustment: Points A and B can typically be adjusted directly by clicking and dragging their markers on the chart (if 'Setup' is set to 'Show'). Changes update settings automatically.



📝 NOTES 📝

Fibonacci circles begin plotting only once the time corresponding to Point B has passed and is confirmed on the chart. While potential center locations might be visible earlier (as shown in the setup graphic), the final circle calculations require the complete geometry of the A-B swing. This approach ensures that as new price bars form, the circles are accurately rendered based on the finalized A-B relationship and the chosen center and scaling.

The indicator's calculations are anchored to user-defined start (A) and end (B) points on the chart. When switching between charts with significantly different price scales (e.g., from an index at 5,000 to a crypto asset at $0.50), it is typically necessary to adjust these anchor points to ensure the circle elements are correctly positioned and scaled.


⚠️ DISCLAIMER ⚠️

The Fibonacci Circle Zones indicator is a visual analysis tool designed to illustrate Fibonacci relationships through geometric constructions incorporating curved lines, providing a structured framework for identifying potential areas of price interaction. Like all technical and visual indicators, these visual representations may visually align with key price zones in hindsight, reflecting observed price dynamics. It is not intended as a predictive or standalone trading signal indicator.

The indicator calculates levels and projections using user-defined anchor points and Fibonacci ratios. While it aims to align with TradingView’s standard Fibonacci circle tool by employing mathematical and geometric formulas, no guarantee is made that its calculations are identical to TradingView's proprietary methods.


🧠 BEYOND THE CODE 🧠

The Fibonacci Circle Zones indicator, like other xxattaxx indicators, is designed with education and community collaboration in mind. Its open-source nature encourages exploration, experimentation, and the development of new Fibonacci and grid calculation indicators and tools. We hope this indicator serves as a framework and a starting point for future Innovation and discussions.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.