What Is This Indicator?
Original Time Cycles – W.D. Gann [AlgoFuego] is an advanced TradingView indicator inspired directly by the time-cycle principles introduced by W.D. Gann in his legendary work The Tunnel Thru the Air; Or, Looking Back from 1940.
Unlike conventional technical indicators that react to price levels or momentum, this tool treats time as the cause and price as the effect — identifying precise future reversal zones before price confirms them.
At its core, the indicator assumes that markets move according to natural time divisions, and that trends tend to change when specific cycles complete:
“When time is up, the trend changes.” — W.D. Gann
The Four Pillars of Gann's Time Theory
Every signal this indicator generates is rooted in four core principles drawn directly from Gann's writings:
- Time Governs All Market Movement — Price is the effect; time is the cause. Understanding when a move will end is more powerful than knowing where it will end.
- Law of Vibration & Harmonics — Markets vibrate at specific frequencies. Harmonic divisions reveal future paths through the same mathematical ratios found in nature and music.
- Geometry & Mathematical Sequences — All calculations are based on cycle theory and mathematical sequences, just as an astronomer calculates celestial movements using geometry and immutable laws.
- History Repeats at Fixed Intervals — Everything works according to past cycles. Similar time and geometric conditions produce similar outcomes: “Like causes produce like effects.”
Decoding Gann's Secret: The Default Cycle
The indicator's default settings encode Gann's own documented cycle hidden within The Tunnel Thru the Air. The decoding follows these clues:
- Secret Key (book cover): “THRU” and “1940”
- Starting Point (Foreword): May 9, 1927
- Principle (Page 371): Days = Years = Degrees
- Cycle End (Page 405): August 30, 1932
- Cycle Length: 1,940 days — from May 9, 1927 to August 30, 1932
This 1,940-day cycle covered Gann's predicted period of global turmoil — wars, panics, and economic crisis — validating his forecasting methodology across a real historical sequence.
How It Works: Core Mechanics
The indicator operates through four interconnected components that transform Gann's theory into a functional trading system:
1. Anchor Date & Cycle Length
Users select a historically significant reference date — a major market top or bottom, a war, a financial crisis, or an astronomical event — as the cycle's origin point. From this anchor, a fixed cycle length (measured in days) defines when each cycle begins and ends. All future turning date projections flow mathematically from this single starting point.
“History repeats itself. In order to know and predict the future of anything you only have to look up what has happened in the past and get a correct base or starting point.” — W.D. Gann, Page 75
2. Full Cycles & Harmonic Subdivisions
The indicator visualizes the complete cycle arc as a sinusoidal wave and divides it into harmonic fractional segments. These subdivisions reveal major and minor turning points at every harmonic degree — mirroring Gann's description of cycles within cycles: “Wheel within a wheel.”
- Subdivisi → 0° / 180° / 360°
- Subdivisi → 0° / 120° / 240° / 360°
- Subdivisi (default) → 0° / 90° / 180° / 270° / 360°
- Subdivisi → 0° / 72° / 144° / 216° / 288° / 360°
3. Modular Arithmetic Engine
The script uses modular arithmetic — the same principle as clock arithmetic — to map any calendar date into its repeating cycle position, regardless of how far it lies from the visible chart. If a cycle is 1,940 days, and 15,000 days have passed since the anchor, modular arithmetic finds the exact cycle phase: 15000 % 1940 = 420 (day 420 of the current cycle).
This architecture enables analysis of 60-year, 100-year, or 1,000-year macro cycles — independent of available bar history on TradingView.
4. Dual Operation Modes
Two distinct trading modes allow flexible strategy construction:
- Angle Positions Mode — Trade between predefined geometric degree ranges. Entry triggers when the cycle reaches a specified angle (e.g., 0°); exit triggers at another defined angle (e.g., 120°). Ideal for geometric purists applying Gann's harmonic degree logic.
- Fractional Cycle Mode — Signals generate automatically when the wave phase shifts direction (falling-to-rising for Long; rising-to-falling for Short). An optional bar-count exit closes trades after a defined number of bars, offering rhythm-based automated signal generation.
The Trade Engine
The built-in trade engine automatically generates on-chart visual markers for every trade event, with full customization of all parameters:
- Entry Levels — Visually marked at every signal trigger with configurable label size and color
- Stop-Loss — Toggle on/off with percentage distance from entry price
- Take-Profit — Toggle on/off with percentage distance from entry price
- Exit Levels — Marked at cycle-defined exit points with matching visual markers
- Commission Simulation — Separate entry and exit commission percentages for realistic backtesting
Performance Analytics & Statistics
A comprehensive performance table renders directly on the TradingView chart, summarizing all completed cycles with the following metrics:
- Signal Type (Angle Positions or Fractional Cycles)
- Number of Trades — Wins / Losses / Total
- Maximum, Minimum, and Average Returns per cycle
- Win Rate (%)
- Compound Return (before and after commission)
- Expected Date of Next Trading Signal — A forward projection of the next entry or exit window based on time-cycle mathematics
Next Turning Date Forecast
The indicator's forward projection engine calculates the exact date when the current cycle is expected to complete — providing a specific future window for planning entries, exits, and stop placement in advance. This transforms Gann's forecasting philosophy into a calendar-based decision system:
“I will buy or sell the market on a specific date in the future with a specific stop loss and target, and I will exit on a specific date.”
The Next Turning Date is derived from modular arithmetic applied to the anchor date and cycle length — not from price behavior — making it a true time-only projection independent of market conditions at the time of calculation.
Dynamic Visualization
The indicator enhances chart readability through multiple visual layers working simultaneously:
- Cycle Wave Lines — Sinusoidal arcs showing the full cycle and each harmonic subdivision phase
- Dynamic Candle Coloring — Candles adapt color automatically based on the current cycle phase and active trade state
- Background Highlights — Phase change zones are shaded for instant visual identification of cycle boundaries
- Anchor Reset Markers — Visual indicators at each new cycle commencement point
Alert System
Four independent alert types can be enabled or disabled individually, ensuring you receive only the notifications relevant to your current strategy:
- Entry Alert — Triggers when a new trade entry signal is generated by the active mode
- Exit Alert — Triggers when the position is closed by a cycle-defined exit signal
- Stop-Loss Alert — Triggers when price reaches the defined stop level
- Take-Profit Alert — Triggers when price reaches the defined target level
Default Settings Reference
The indicator ships with the following default configuration, encoding Gann's own documented historical cycle:
- Anchor Date: May 9, 1927
- Cycle Length: 1,940 days
- Subdivisions: 4 (producing 0° / 90° / 180° / 270° / 360°)
- Required Timeframe: 1-Day chart only
These defaults allow you to immediately observe how Gann's own cycle maps against a century of market history before customizing parameters for your specific trading objectives.
How to Use: Step-by-Step
Follow this sequence to implement the indicator correctly from the first session:
- Step 1 — Switch to the 1-Day Timeframe. This is mandatory. Gann's mathematical framework uses days as the fundamental unit equivalent to degrees and years. Intraday application will produce incorrect calculations.
- Step 2 — Choose Your Anchor Date. Select a major historical event relevant to your market. The more significant the anchor, the more precisely the cycle will map onto historical turning points. Start with the default (May 9, 1927) to calibrate your understanding of the tool before customizing.
- Step 3 — Set the Cycle Length. Begin with 1,940 days (Gann's own cycle) or try 360 days (one harmonic year). Adjust and observe how cycle completions align with historical reversals on your chart.
- Step 4 — Choose Your Operating Mode. Select Angle Positions for geometric, degree-defined entries and exits. Select Fractional Cycle for automatic wave-direction signals.
- Step 5 — Configure Subdivisions. The default of 4 (quarterly 90° intervals) is the recommended starting point. Increase to 5 for finer granularity or reduce to 2 for major cycle-only signals.
- Step 6 — Backtest with the Performance Table. Review win rate, cycle returns, and compound equity growth across completed cycles. Enable commission simulation for realistic results. Confirm statistical consistency before live application.
- Step 7 — Note the Next Turning Date. Record the projected next cycle completion date and plan your trading actions around that window in advance.
- Step 8 — Apply the Law of Vibration. When the market produced a strong reaction at a harmonic in the past, anticipate a similar response when that vibration recurs. Document outcomes continuously to build a personal cycle reference for each market you trade.
Technical Specifications
Complete technical details for integration and deployment on TradingView:
- Platform: TradingView
- Language: Pine Script v6
- Required Timeframe: 1-Day chart (mandatory)
- Supported Assets: Forex, Crypto, Stocks, Commodities, Indices
- Operation Modes: Angle Positions · Fractional Cycles
- Backtesting: Long & Short simulation with commission modeling
- Alert Types: Entry · Exit · Stop-Loss · Take-Profit (individually configurable)
- Updates: Lifetime updates included with active subscription
- Last Updated: January 2025
Important Disclosure
Original Time Cycles – W.D. Gann [AlgoFuego] is a technical analysis and research tool, not a guaranteed profit system. While cycle-based models offer meaningful perspective on market timing, past cycle behavior does not guarantee future performance. Market conditions are also shaped by fundamental developments, macroeconomic events, and sentiment shifts that purely time-based systems do not account for. Always apply sound risk management and use cycle analysis as one component of a broader trading framework.
“Mathematical science furnishes unmistakable proof of history repeating itself and shows that the cycle theory, or harmonic analysis, is the only thing that we can rely upon to ascertain the future.” — W.D. Gann, Page 77