OPEN-SOURCE SCRIPT
Trigonometric Sine Cosine Waves

Trigonometric Sine Cosine Waves - Advanced Cyclical Analysis
Overview
This innovative indicator applies trigonometric mathematics to market analysis, generating dynamic sine and cosine waves that adapt to price movement and volatility. Unlike traditional oscillators, this tool visualizes market cycles directly on your chart using mathematical wave functions.
How It Works
The indicator calculates phase-based waves using:
• Phase Calculation: 2π × bar_index / cycle_length
• Adaptive Amplitude: EMA-based price + ATR volatility scaling
• Sine Wave: avgPrice + volatility × sin(phase)
• Cosine Wave: avgPrice + volatility × cos(phase)
Key Features
Dynamic Wave Generation
• Sine Wave: Primary cycle indicator with smooth transitions
• Cosine Wave: Leading indicator (90° phase difference from sine)
• Adaptive Amplitude: Automatically adjusts to market volatility using ATR
Turning Point Detection
• Anti-Repaint Signals: Uses confirmed values from previous bars
• Sine Bottom: Potential buy zones when wave transitions from down to up
• Sine Top: Potential sell zones when wave transitions from up to down
Advanced Analytics
• Price Correlation Angle: Shows relationship between price movement and cycle
• Phase Information: Current position in the mathematical cycle
• Real-time Values: Live sine/cosine values and phase degrees
Visual Enhancement
• Background Coloring: Changes based on sine wave position (above/below zero)
• Clean Overlay: Waves plot directly on price chart without cluttering
Parameters
• Cycle Length (5-200): Controls wave frequency - shorter = more sensitive
• Amplitude Multiplier (0.1-5.0): Adjusts wave height relative to volatility
• Display Options: Toggle sine wave, cosine wave, and correlation table
• Show Correlation: Optional table showing mathematical values
Trading Applications
Cycle Analysis
• Identify market rhythm and timing
• Spot potential reversal zones
• Understand price-to-cycle relationships
Entry/Exit Timing
• Buy Signals: Sine wave bottoms (cycle lows)
• Sell Signals: Sine wave tops (cycle highs)
• Confirmation: Use with other indicators for higher probability setups
Market Structure
• Visualize underlying market cycles
• Identify periods of high/low cyclical activity
• Track phase relationships between price and mathematical cycles
Pro Tips
1. Longer cycles (50-100) work better for swing trading
2. Shorter cycles (10-20) suitable for scalping
3. Combine with volume for stronger signal confirmation
4. Monitor correlation angle for trend strength assessment
5. Use background color as quick visual cycle reference
Important Notes
• Signals are anti-repaint using confirmed previous bar values
• Best used in trending or cyclical markets
• Consider market context when interpreting signals
• Mathematical approach - not based on traditional TA concepts
Alerts Included
• Sine Wave Buy Signal: Triggered on wave bottom detection
• Sine Wave Sell Signal: Triggered on wave top detection
Technical Requirements
• Pine Script v6
• Works on all timeframes
• No external dependencies
• Optimized for performance
This is a free, open-source indicator. Feel free to modify and improve according to your trading needs!
Educational Value: Perfect for understanding how mathematical functions can be applied to market analysis and cycle detection.
Overview
This innovative indicator applies trigonometric mathematics to market analysis, generating dynamic sine and cosine waves that adapt to price movement and volatility. Unlike traditional oscillators, this tool visualizes market cycles directly on your chart using mathematical wave functions.
How It Works
The indicator calculates phase-based waves using:
• Phase Calculation: 2π × bar_index / cycle_length
• Adaptive Amplitude: EMA-based price + ATR volatility scaling
• Sine Wave: avgPrice + volatility × sin(phase)
• Cosine Wave: avgPrice + volatility × cos(phase)
Key Features
Dynamic Wave Generation
• Sine Wave: Primary cycle indicator with smooth transitions
• Cosine Wave: Leading indicator (90° phase difference from sine)
• Adaptive Amplitude: Automatically adjusts to market volatility using ATR
Turning Point Detection
• Anti-Repaint Signals: Uses confirmed values from previous bars
• Sine Bottom: Potential buy zones when wave transitions from down to up
• Sine Top: Potential sell zones when wave transitions from up to down
Advanced Analytics
• Price Correlation Angle: Shows relationship between price movement and cycle
• Phase Information: Current position in the mathematical cycle
• Real-time Values: Live sine/cosine values and phase degrees
Visual Enhancement
• Background Coloring: Changes based on sine wave position (above/below zero)
• Clean Overlay: Waves plot directly on price chart without cluttering
Parameters
• Cycle Length (5-200): Controls wave frequency - shorter = more sensitive
• Amplitude Multiplier (0.1-5.0): Adjusts wave height relative to volatility
• Display Options: Toggle sine wave, cosine wave, and correlation table
• Show Correlation: Optional table showing mathematical values
Trading Applications
Cycle Analysis
• Identify market rhythm and timing
• Spot potential reversal zones
• Understand price-to-cycle relationships
Entry/Exit Timing
• Buy Signals: Sine wave bottoms (cycle lows)
• Sell Signals: Sine wave tops (cycle highs)
• Confirmation: Use with other indicators for higher probability setups
Market Structure
• Visualize underlying market cycles
• Identify periods of high/low cyclical activity
• Track phase relationships between price and mathematical cycles
Pro Tips
1. Longer cycles (50-100) work better for swing trading
2. Shorter cycles (10-20) suitable for scalping
3. Combine with volume for stronger signal confirmation
4. Monitor correlation angle for trend strength assessment
5. Use background color as quick visual cycle reference
Important Notes
• Signals are anti-repaint using confirmed previous bar values
• Best used in trending or cyclical markets
• Consider market context when interpreting signals
• Mathematical approach - not based on traditional TA concepts
Alerts Included
• Sine Wave Buy Signal: Triggered on wave bottom detection
• Sine Wave Sell Signal: Triggered on wave top detection
Technical Requirements
• Pine Script v6
• Works on all timeframes
• No external dependencies
• Optimized for performance
This is a free, open-source indicator. Feel free to modify and improve according to your trading needs!
Educational Value: Perfect for understanding how mathematical functions can be applied to market analysis and cycle detection.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
Aga Tarigan
t.me/AT777mind
t.me/AT777mind
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
Aga Tarigan
t.me/AT777mind
t.me/AT777mind
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。