OPEN-SOURCE SCRIPT
Pi Cycle BTC Top + Pre-Alert Bands

Pi Cycle BTC Top + Pre-Alert Bands is an advanced implementation of the classic Pi Cycle Top model, designed for Bitcoin cycle analysis on higher timeframes (especially 1D BTCUSD/BTCUSD·INDEX).
The original Pi Cycle Top uses two moving averages:
• 111-day SMA (short MA)
• 350-day SMA ×2 (long MA)
A Pi Top is signaled when the 111 SMA crosses above the 350×2 SMA. Historically, this has occurred near major BTC cycle highs.
This script extends that idea with a 3-step early-warning sequence:
• Pi Green – early compression: short/long MA ratio crosses upward into the green band (convergence from below is required).
• Pi Yellow – mid-cycle warning: only fires if a valid Green has already occurred in the same cycle.
• Pi Cycle Top – final top: the classic Pi Cycle cross, limited to one top signal per cycle. After a top, no new Yellow or Top signals can appear until a new Green event starts the next cycle.
Background shading shows the active phase (Green / Yellow / late-cycle zone), so you can see at a glance where BTC is within its Pi-based macro structure.
All logic is non-repainting: request.security() uses lookahead_off and no future data is accessed.
Typical use
This indicator is intended as a macro-cycle timing and risk-awareness tool, not a stand-alone entry system. Many traders use it to:
• Watch for Pi Green as the start of a potential late-cycle advance.
• Treat Pi Yellow as a rising-risk environment and tighten risk management.
• Use the Pi Cycle Top as a historical high-risk zone where large profit-taking or hedging may be considered.
Always combine this with your own analysis (trend, volume, on-chain, macro) before making decisions.
How to set alerts
Add the indicator to your chart (1D BTCUSD or BTCUSD·INDEX recommended).
Click Alerts → Condition → Pi Cycle BTC Top + Pre-Alert Bands.
Choose one of:
• Pi Cycle – Green Pre-Alert (early convergence)
• Pi Cycle – Yellow Pre-Alert (after Green only)
• Pi Cycle – TOP (Single per Cycle, after Green)
Use “Once per bar close” for higher-timeframe reliability.
Disclaimer
This tool is for educational and analytical purposes only. The Pi Cycle concept is based on historical behavior and does not guarantee future results. This is not financial advice; always do your own research and manage risk appropriately.
The original Pi Cycle Top uses two moving averages:
• 111-day SMA (short MA)
• 350-day SMA ×2 (long MA)
A Pi Top is signaled when the 111 SMA crosses above the 350×2 SMA. Historically, this has occurred near major BTC cycle highs.
This script extends that idea with a 3-step early-warning sequence:
• Pi Green – early compression: short/long MA ratio crosses upward into the green band (convergence from below is required).
• Pi Yellow – mid-cycle warning: only fires if a valid Green has already occurred in the same cycle.
• Pi Cycle Top – final top: the classic Pi Cycle cross, limited to one top signal per cycle. After a top, no new Yellow or Top signals can appear until a new Green event starts the next cycle.
Background shading shows the active phase (Green / Yellow / late-cycle zone), so you can see at a glance where BTC is within its Pi-based macro structure.
All logic is non-repainting: request.security() uses lookahead_off and no future data is accessed.
Typical use
This indicator is intended as a macro-cycle timing and risk-awareness tool, not a stand-alone entry system. Many traders use it to:
• Watch for Pi Green as the start of a potential late-cycle advance.
• Treat Pi Yellow as a rising-risk environment and tighten risk management.
• Use the Pi Cycle Top as a historical high-risk zone where large profit-taking or hedging may be considered.
Always combine this with your own analysis (trend, volume, on-chain, macro) before making decisions.
How to set alerts
Add the indicator to your chart (1D BTCUSD or BTCUSD·INDEX recommended).
Click Alerts → Condition → Pi Cycle BTC Top + Pre-Alert Bands.
Choose one of:
• Pi Cycle – Green Pre-Alert (early convergence)
• Pi Cycle – Yellow Pre-Alert (after Green only)
• Pi Cycle – TOP (Single per Cycle, after Green)
Use “Once per bar close” for higher-timeframe reliability.
Disclaimer
This tool is for educational and analytical purposes only. The Pi Cycle concept is based on historical behavior and does not guarantee future results. This is not financial advice; always do your own research and manage risk appropriately.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.