編輯精選
OPEN-SOURCE SCRIPT

[MAD] Gann o Maticus

17 031
Gannomat — Full Automated Gann Grids & Astro Cycles
Automatic Gann quadrant boxes with geometric arc projections. Cycle boundaries from standard timeframes or real planetary astronomy.

Thanks BarefootJoey, master of Astrolib

What Does This Indicator Do?

Gannomat draws a Gann quadrant box on your chart — a rectangle where the width represents a time period and the height represents a price range. Inside each box, it projects geometric arc curves from all four corners at multiple proportional levels (1x0 through 5x0, plus diagonal variants 1x1 through 5x1). These arcs create a web of curved support and resistance lines based on the time–price geometry of the quadrant.

Each time a new period begins — either a new timeframe candle or a new astronomical event — the box resets and a fresh set of arcs is drawn.

The indicator also plots pivot point markers (R3, R2, R1, PP, S1, S2, S3) as small circles whenever their values change, and draws diagonal cross lines connecting opposite corners of the box.

When using Astrocycles mode, an info table in the top-right corner shows the active planet, cycle type, current cycle duration in days, and the dates of the last and next astronomical event.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
INPUT REFERENCE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
General
  • Line Width (Default: 1) — Thickness of all drawn lines and arc curves. Increase for better visibility on higher-resolution screens.
  • Box Color (Default: Gray 50%) — Color of the quadrant box outline, its vertical/horizontal edges, and the diagonal cross lines.
  • Gann Circles Color (Default: Blue) — Color reserved for Gann circle overlays.
  • Cleanup Old Drawings (Default: On) — When enabled, previous box and arc drawings are removed when a new period starts. Turn off if you want to keep all historical boxes visible.

Time Settings
  • Timeframe / Cycle (Default: 1 Day) — This is the most important setting. It controls how wide each Gann box is.

Available options:
  • 15 Min, 1 Hour, 4 Hours, 6 Hours, 8 Hours, 12 Hours — Intraday periods. Use these on lower timeframe charts (1m–15m–1H).
  • 1 Day — One trading day. The most common starting point.
  • 1 Week, 2 Weeks, 3 Weeks, 4 Weeks — Weekly periods. Good for swing trading on daily charts.
  • 1 Month, 3 Months, 6 Months — Monthly/quarterly periods. Use on daily or weekly charts for longer-term analysis.
  • Astrocycles — The box width is no longer a fixed timeframe. Instead, each new box begins when a specific planetary event occurs (configured in Astro Settings). The box width varies from cycle to cycle based on the actual interval between consecutive events.

Astro Settings
These settings only take effect when Timeframe / Cycle is set to Astrocycles.
  • Astro Planet (Default: Moon) — Which celestial body drives the cycle timing. Each planet has a different orbital period, producing cycles of different lengths:

  • Moon — ~27 days per cycle. Fast cycles, good for daily charts.
  • Mercury — ~88 days. Short inner-planet cycles.
  • Venus — ~225 days. Medium cycles.
  • Mars — ~687 days (~1.9 years). Good for weekly charts.
  • Jupiter — ~12 years. Long-term cycles for monthly charts.
  • Saturn — ~29 years. Very long-term structural cycles.
  • Uranus, Neptune, Pluto — Multi-decade to multi-century cycles. For the longest-term analysis.

  • Astro Cycle (Default: High Latitude) — The type of astronomical event that marks the start of each new period:

  • High Latitude — The planet reaches its maximum ecliptic latitude (furthest above the ecliptic plane). Works for all planets including Moon.
  • Low Latitude — The planet reaches its minimum ecliptic latitude (furthest below the ecliptic plane). Works for all planets including Moon.

  • High Longitude — The planet reaches a stationary point where its geocentric longitude stops increasing and begins to decrease (start of retrograde motion). This is the retrograde station. Not applicable to Moon.
  • Low Longitude — The planet reaches a stationary point where its geocentric longitude stops decreasing and begins to increase again (end of retrograde / start of direct motion). This is the direct station. Not applicable to Moon.

  • Heliocentric Conjunction — Earth and the selected planet are aligned on the same side of the Sun (0° heliocentric separation). Not available for Moon.
  • Heliocentric Opposition — Earth and the selected planet are on opposite sides of the Sun (180° heliocentric separation). Not available for Moon.

  • Show Info Table (Default: On) — Displays a panel in the top-right corner showing: Cycle Type, Planet, Duration (days), Last Event date, and Next Event date (UTC).

Quadrant Scaling
These settings control the height (Y-axis / price range) of each Gann box.
  • Scale Mode (Default: Classic Pivots) — How the top and bottom price levels of the box are calculated:

  • Classic Pivots — The box height is defined by two pivot levels you choose (see Upper/Lower Pivot below). In standard timeframe mode, pivots are calculated from the previous period's High, Low, Close via request.security. In Astrocycles mode, pivots are calculated from the previous astronomical cycle's High, Low, Close.
  • Prev Cycle Range — The box height equals the High-to-Low range of the previous completed cycle. This adapts the box to actual market movement. If no previous cycle data is available yet, falls back to Classic Pivots.
  • Donchian Channel — The box top is the highest high and the box bottom is the lowest low over the last N bars (set by Donchian Len).
  • ATR Bands — The box is centered on a base price (Close, HL2, or EMA) and extends upward/downward by ATR × Multiplier. This creates volatility-adaptive boxes.
  • StdDev Bands — Same concept as ATR Bands but uses standard deviation instead. Similar to Bollinger Band width. The box is centered on a simple moving average.
  • Percentile Channel — The box top is the upper percentile of highs and the box bottom is the lower percentile of lows over the lookback period. This provides a statistical price range.

  • Upper Pivot (Default: R3) — Which pivot level defines the top of the box. Only used when Scale Mode is Classic Pivots. Options: R3, R2, R1, PP, S1, S2, S3.
  • Lower Pivot (Default: S1) — Which pivot level defines the bottom of the box. Only used when Scale Mode is Classic Pivots. Options: R3, R2, R1, PP, S1, S2, S3.
  • Base Source (Default: Close) — Center line for ATR Bands and StdDev Bands modes. Close uses the closing price, HL2 uses the midpoint of high and low, EMA uses an exponential moving average.
  • Donchian Len (Default: 20) — Lookback period in bars for the Donchian Channel highest-high / lowest-low calculation.
  • ATR Len (Default: 14) — Lookback period for the Average True Range calculation.
  • ATR Mult (Default: 2.0) — How many ATRs above and below the base price to extend the box.
  • StdDev Len (Default: 20) — Lookback period for the standard deviation calculation.
  • StdDev Mult (Default: 2.0) — How many standard deviations above and below the SMA to extend the box.
  • Pct Len (Default: 50) — Lookback period for the percentile calculation.
  • Low % (Default: 10) — Lower percentile threshold (0–49). A value of 10 means the box bottom is at the 10th percentile of lows.
  • High % (Default: 90) — Upper percentile threshold (51–100). A value of 90 means the box top is at the 90th percentile of highs.
  • Min Height (ATR Mult) (Default: 0.5) — Minimum allowed box height, expressed as a multiple of the current ATR. If the calculated box height is smaller than this, the box is expanded symmetrically around its midpoint. Set to 0 to disable. Useful to prevent collapsed or invisible boxes during low-volatility consolidation.

Pivot Colors
  • R3 Color (Default: Dark Green #004900)
  • R2 Color (Default: Medium Green #006F00)
  • R1 Color (Default: Bright Green #009600)
  • PP Color (Default: Gray #555555)
  • S1 Color (Default: Red #FF0000)
  • S2 Color (Default: Red-Pink #FF002A)
  • S3 Color (Default: Deep Pink #FF014A)

Each pivot level is plotted as a small circle marker on the chart whenever its value changes. The color scheme gives a visual gradient from green (resistance) to red (support).
Arc Colors
  • Arc Level 1 Color (Default: Orange) — Color for the smallest arcs: 1x0, 1.5x0, and 1x1.
  • Arc Level 2 Color (Default: Lime) — Color for 2x0 and 2x1 arcs.
  • Arc Level 3 Color (Default: Green) — Color for 3x0 and 3x1 arcs.
  • Arc Level 4 Color (Default: Teal #40826D) — Color for 4x0 and 4x1 arcs.
  • Arc Level 5 Color (Default: Blue) — Color for the largest arcs: 5x0 and 5x1.
  • Arc Inv 4x0 Color (Default: Aqua) — Dedicated color for the inverted 4x0 arc, so it can be visually distinguished from the normal (bottom-up) version.

Each arc level represents a different proportion of the quadrant. Smaller arcs (Level 1) curve tightly near the origin corner, while larger arcs (Level 5) sweep across the full box width. The "x1" variants (1x1, 2x1, etc.) are diagonal-offset versions that sit between the round-number levels.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
HOW TO USE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Getting Started (Standard Mode)
  1. Add the indicator to your chart.
  2. Set Timeframe / Cycle to match the period you want to analyze. For example, on a 1-hour chart analyzing daily structure, choose "1 Day".
  3. Leave Scale Mode on Classic Pivots with Upper = R3, Lower = S1 as a starting point. This gives you a box spanning from the first support to the third resistance.
  4. Observe how price interacts with the arc curves. The arcs act as curved support/resistance levels — price often reverses or accelerates near these lines.
  5. Adjust Upper/Lower Pivot to widen (R3/S3) or narrow (R1/S1) the box depending on volatility.

Using Astrocycles Mode
  1. Set Timeframe / Cycle to Astrocycles.
  2. Choose a Planet. Start with Moon for fast cycles on daily charts, or Jupiter/Saturn for long-term cycles on weekly/monthly charts.
  3. Choose a Cycle type. High Latitude is a good general-purpose starting point since it works for all planets.
  4. Enable Show Info Table to see the current cycle duration and event dates.
  5. For scaling, try Prev Cycle Range — it pairs naturally with Astrocycles because it sizes each new box based on the price action of the previous planetary cycle.

Choosing a Scale Mode
  • Use Classic Pivots for traditional Gann analysis with well-defined pivot-based boundaries.
  • Use Prev Cycle Range when you want boxes that reflect actual market range — especially good with Astrocycles.
  • Use ATR Bands or StdDev Bands when you want the box to automatically adapt to changing volatility conditions.
  • Use Donchian Channel for a simple recent-range approach.
  • Use Percentile Channel for a statistical approach that filters out extreme spikes.

Reading the Arcs
  • Bottom-up arcs (normal) rise from the lower-left corner of the box. They represent potential support curves during an uptrend.
  • Top-down arcs (inverted) fall from the upper-left corner. They represent potential resistance curves during a downtrend.
  • The right-side arcs (mirrored from the right corners) appear in the current box via polyline drawing, creating the full four-corner Gann circle pattern.
  • When multiple arcs from different levels converge at the same point, that creates a confluence zone — a stronger potential reaction area.
  • The diagonal cross lines show the direct price-time relationship (1:1 ratio) across the box.

Tips
  • If boxes appear too flat or collapsed, increase Min Height (ATR Mult) from 0.5 to 1.0 or higher.
  • The chart timeframe should be lower than the selected period. For example, use a 1H chart with a 1 Day period, or a Daily chart with a 1 Week period. This ensures enough bars exist within each box for the arcs to render smoothly.
  • For Heliocentric Conjunction/Opposition cycles, remember these are only available for planets other than the Moon. These cycles correspond to synodic periods (the time between successive alignments as seen from the Sun).
  • High/Low Longitude cycles detect retrograde and direct stations — moments when a planet appears to change direction in the sky. These are astronomically significant turning points often studied in financial astrology.

免責聲明

這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。