PROTECTED SOURCE SCRIPT

Green Pill 🟢 Red Pill 🔴

339
Green Pill 🟢 Red Pill 🔴 Indicator

Overview

The Green Pill 🟢 Red Pill 🔴 is a momentum-based trend indicator designed to simplify market entry and exit signals. Built upon the classic Moving Average Convergence Divergence (MACD) logic, this oscillator transforms raw data into clear, actionable visual cues—"Pills"—that help traders identify shifts in market momentum instantly.

Unlike standard MACD tools that require you to interpret line crossovers manually, this indicator automatically detects these crossovers relative to a customizable threshold and projects clear Long (Green Pill) and Short (Red Pill) labels directly onto the indicator pane.

How It Works

This script calculates the momentum of the asset by comparing two Exponential Moving Averages (EMAs):

MACD Line: Derived from the difference between the Fast Length and Slow Length EMAs.

Signal Line: An EMA of the MACD Line itself.

Histogram: The difference between the MACD Line and the Signal Line.

The "Pill" Logic

Signals are generated based on the Histogram's interaction with a user-defined Signal Threshold:

🟢 Green Pill (Long Signal): Triggered when the Histogram crosses above the threshold. This suggests bullish momentum is building.

🔴 Red Pill (Short Signal): Triggered when the Histogram crosses below the threshold. This suggests bearish momentum is taking over.

Features

Visual Clarity: Bright, distinct labels (Green/Red Pills) make it easy to spot trend reversals at a glance.

Customizable Sensitivity: The Signal Threshold input allows you to filter out "noise" in ranging markets. Increasing this value requires stronger momentum to trigger a signal.

Full MACD Visualization: Includes the standard Histogram, MACD Line, and Signal Line for deeper technical analysis.

Alert Ready: Built-in alert conditions allow you to set up TradingView alerts for both Green and Red Pill signals, ensuring you never miss a move.

Settings

Fast Length (Default: 12): The period for the fast EMA.

Slow Length (Default: 26): The period for the slow EMA.

Signal Length (Default: 9): The smoothing period for the signal line.

Signal Threshold (Default: 0.0): The value the histogram must cross to trigger a signal. Set higher to filter out weak signals or keep at 0.0 for standard zero-line crossovers.

How to Use

Add the indicator to your chart.

Look for a Green Pill 🟢 label as a potential buy/long entry signal.

Look for a Red Pill 🔴 label as a potential sell/short entry signal.

Use the colored Histogram bars to gauge the strength of the current trend.

Pernyataan Penyangkalan

Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.