## Description This indicator monitors and visualizes candlestick divergences between SPY (S&P 500 ETF) and TQQQ (ProShares UltraPro QQQ ETF). It identifies situations where one security is showing bullish movement (green candle) while the other is showing bearish movement (red candle) within the same time period.
## Features - Real-time divergence detection between SPY and TQQQ - Visual markers with distinct colors for each type of divergence - Built-in alert conditions for automated monitoring - Works on any timeframe - Overlay indicator that plots directly on the chart
## Divergence Types
### SPY Bullish / TQQQ Bearish - Condition: SPY forms a green candle while TQQQ forms a red candle - Marker: Green label with "SPY" text above the bar - Alert Message: "SPY is green while TQQQ is red"
### SPY Bearish / TQQQ Bullish - Condition: SPY forms a red candle while TQQQ forms a green candle - Marker: Red label with "SPY" text below the bar - Alert Message: "TQQQ is green while SPY is red"
### TQQQ Bullish / SPY Bearish - Visualization: Blue label with "TQQQ" text above the bar - Indicates TQQQ strength relative to SPY
### TQQQ Bearish / SPY Bullish - Visualization: Purple label with "TQQQ" text below the bar - Indicates TQQQ weakness relative to SPY
## Technical Implementation - Built on Pine Script version 5 - Uses `request.security()` to fetch data for both symbols - Implements simple candle color detection (1 for green, -1 for red, 0 for doji) - Plots markers using `plotshape()` with different colors and positions
## Visual Elements - Label Colors: - SPY Bullish: Green - SPY Bearish: Red - TQQQ Bullish: Blue - TQQQ Bearish: Purple - All labels use white text for visibility - Small label size for clean chart appearance - Labels positioned above/below bars for clear identification
## Alert System Two built-in alert conditions: 1. "SPY Green TQQQ Red Divergence" 2. "TQQQ Green SPY Red Divergence"
## Usage 1. Add the indicator to any chart (preferably SPY or TQQQ) 2. Look for colored labels indicating divergences 3. Set up alerts for automated monitoring 4. Use divergences as potential signals for: - Market sector rotation - Relative strength analysis - Trading opportunities - Risk management
## Notes - Best used in conjunction with other technical indicators - Consider overall market conditions when interpreting signals - Useful for identifying potential market reversals or continuations - Can help in timing entries and exits
## Limitations - Requires data feed for both SPY and TQQQ - Only considers candle color, not candle size or volume - May generate frequent signals in choppy markets
## Disclaimer This indicator is for informational purposes only. Always use proper risk management and consider multiple factors when making trading decisions.
סקריפט מוגן
סקריפט זה פורסם כמקור סגור. עם זאת, אתה יכול להשתמש בו באופן חופשי וללא כל הגבלה - למד עוד כאן.
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.