This TradingView script implements the Pi Cycle Top & Bottom Oscillator, a technical indicator designed to identify potential market tops and bottoms using moving average relationships. Here's a detailed breakdown:
Indicator Overview Purpose: The indicator calculates an oscillator based on the ratio of a 111-day simple moving average (SMA) to double the 350-day SMA. It identifies potential overbought (market tops) and oversold (market bottoms) conditions. Visualization: The oscillator is displayed in a standalone pane with dynamic color coding to represent different market conditions. Inputs 111-Day Moving Average Length (length_111): Adjustable parameter for the short-term moving average. Default is 111 days. 350-Day Moving Average Length (length_350): Adjustable parameter for the long-term moving average. Default is 350 days. Overheat Threshold (upper_threshold): Percentage level above which the market is considered overheated. Default is 100%. Cooling Down Threshold (lower_threshold): Percentage level below which the market is cooling down. Default is 75%. Calculation Moving Averages: 111-day SMA of the closing price. 350-day SMA of the closing price. Double the 350-day SMA ( 𝑚 𝑎 _ 2 _ 350 = 𝑚 𝑎 _ 350 × 2 ma_2_350=ma_350×2). Oscillator: Ratio of the 111-day SMA to double the 350-day SMA, expressed as a percentage: oscillator = 𝑚 𝑎 _ 111 𝑚 𝑎 _ 2 _ 350 × 100 oscillator= ma_2_350 ma_111 ×100 Market Conditions Overheated Market (Potential Top): Oscillator >= Overheat Threshold (100% by default). Highlighted in red. Cooling Down Market (Potential Bottom): Oscillator <= Cooling Down Threshold (75% by default). Highlighted in green. Normal Market Condition: Oscillator is between these thresholds. Highlighted in blue. Visual Features Dynamic Oscillator Plot: Color-coded to indicate market conditions: Red: Overheated. Green: Cooling down. Blue: Normal condition. Threshold Lines: Red Dashed Line: Overheat Threshold. Green Dashed Line: Cooling Down Threshold. White Dashed Line: Additional high-value marker at 30 for reference. Alerts Overheat Alert: Triggers when the oscillator crosses the overheat threshold, signaling a potential market top. Cooling Down Alert: Triggers when the oscillator crosses the cooling down threshold, signaling a potential market bottom. Use Case This script is particularly useful for traders seeking early signals of market reversals. The thresholds and dynamic color coding provide visual cues and alerts to aid decision-making in identifying overbought or oversold conditions.
진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.