OPEN-SOURCE SCRIPT

EMA Channel Key K-Lines

979
EMA Channel Setup:
  1. Three 32-period EMAs (high, low, close prices)
  2. Visually distinct colors (red, blue, green)
  3. Gray background between high and low EMAs


Key K-line Identification:
  1. For buy signals: Close > highest EMA, K-line height ≥ channel height, body ≥ 2/3 of range
  2. For sell signals: Close < lowest EMA, K-line height ≥ channel height, body ≥ 2/3 of range
  3. Alternating signals only (no consecutive buy/sell signals)


Visual Markers:
  1. Green "BUY" labels below key buy K-lines
  2. Red "SELL" labels above key sell K-lines
  3. Clear channel visualization


Logic Flow:
  1. Tracks last signal direction to prevent consecutive same-type signals
  2. Strict conditions ensure only significant breakouts are marked
  3. All calculations based on your exact specifications

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.