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.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.