OPEN-SOURCE SCRIPT

Pi Cycle BTC Top + Pre-Alert Bands

45
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.

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน