OPEN-SOURCE SCRIPT
Mis à jour

EMA MACD Trend Decision Table

776
EMA MACD Decision Table v6

This Pine Script v6 overlay indicator summarizes trend, momentum, volume, higher-timeframe context, and ATR-based planning levels into one decision table.

The indicator uses EMA 9, EMA 21, EMA 50, EMA 100, EMA 200, MACD, RSI, ADX / DMI, volume confirmation, optional higher-timeframe EMA trend, and ATR risk planning.

It produces a numeric decision score on every bar. Bullish confirmations add points, bearish confirmations subtract points, and the final score is converted into Strong Buy, Buy, Neutral, Sell, or Strong Sell.

BUY labels appear only when the score first reaches Strong Buy territory. SELL labels appear only when the score first reaches Strong Sell territory.

This tool is designed for chart context and planning. It is not financial advice and does not guarantee trade results.

Scoring Logic

Condition | Score
--- | ---
EMA 9 above EMA 21 and price above EMA 50 | +2
EMA 9 below EMA 21 and price below EMA 50 | -2
Price above EMA 200 | +1
Price below EMA 200 | -1
MACD above signal and histogram above 0 | +2
MACD below signal and histogram below 0 | -2
MACD bullish crossover | +1
MACD bearish crossover | -1
RSI above 55 | +1
RSI below 45 | -1
ADX above threshold and +DI above -DI | +1
ADX above threshold and -DI above +DI | -1
Volume above average and candle closes above open | +1
Volume above average and candle closes below open | -1
Higher-timeframe close above its EMA when enabled | +1
Higher-timeframe close below its EMA when enabled | -1

Decision Output

Score Range | Decision
--- | ---
>= 5 | Strong Buy
2 to 4 | Buy
-1 to 1 | Neutral
-2 to -4 | Sell
<= -5 | Strong Sell

Decision Table Rows

Row | What It Shows | How To Read It
--- | --- | ---
Decision | Final decision and total score | Main summary of bullish, bearish, or mixed confirmation
Last Price | Latest close and price direction | Shows current price context
Bar Change | Close-to-close change and percent change | Positive is above prior close, negative is below prior close
O / H / L | Current open, high, and low | Shows current candle range
EMA 9 / EMA 21 | Short-term EMA relationship | EMA 9 above EMA 21 is bullish, below is bearish
EMA 50 / EMA 200 | Medium and long trend context | Price above EMA 200 supports bullish trend, below supports bearish trend
MACD | MACD state and histogram | Bullish when MACD is above signal and histogram is positive
RSI | RSI state and value | Above 55 bullish, below 45 bearish, above 70 overbought, below 30 oversold
ADX / DMI | Trend strength and direction | Strong +DI lead is bullish, strong -DI lead is bearish
Volume | Volume confirmation | Above-average bullish candle confirms buyers; bearish candle confirms sellers
HTF Trend | Optional higher-timeframe EMA trend | Bullish above HTF EMA, bearish below, Off when disabled
ATR | Current Average True Range | Risk planning unit
Long Plan | ATR-based long stop and target | Reference levels only
Short Plan | ATR-based short stop and target | Reference levels only

Candle Color Meaning

Score Range | Meaning | Candle Color
--- | --- | ---
>= 5 | Strong Buy | Lime
2 to 4 | Buy | Green
-1 to 1 | Neutral | Normal chart color
-2 to -4 | Sell | Maroon
<= -5 | Strong Sell | Red

ATR Planning Formulas

Plan | Formula
--- | ---
Long stop | close - ATR * stop multiplier
Long target | close + (close - long stop) * reward/risk
Short stop | close + ATR * stop multiplier
Short target | close - (short stop - close) * reward/risk

Data Window Values

Code | Meaning
--- | ---
2 | Strong Buy
1 | Buy
0 | Neutral
-1 | Sell
-2 | Strong Sell

Alert Logic

The script includes alerts for Strong Buy Decision, Strong Sell Decision, MACD Bullish Cross, and MACD Bearish Cross.

Strong decision alerts trigger when the score enters strong buy or strong sell territory. MACD alerts are based only on MACD line and signal line crossovers.

Reading The Output

Green output means bullish confirmations are stronger.
Red output means bearish confirmations are stronger.
Gray output means conditions are mixed or neutral.

The decision score is strongest when trend, momentum, volume, and higher-timeframe direction all agree.
Notes de version
EMA MACD Decision Table v6

A chart-overlay decision-support indicator that combines several technical confirmations into a single score, an on-chart table, labels and bar colors. It is a decision aid, not a guarantee of trade outcomes. For educational purposes only.


What it calculates
  • EMA 9, EMA 21, EMA 50, EMA 100 and EMA 200
  • MACD line, signal line and histogram
  • RSI momentum
  • ADX and DMI trend strength and direction
  • Volume confirmation versus average volume
  • Optional higher-timeframe EMA trend
  • ATR-based stop and target planning levels


Decision score logic
The script starts at 0 and adds bullish or bearish points:
  • EMA 9 above EMA 21 and price above EMA 50: +2 (opposite: -2)
  • Price above EMA 200: +1 (below: -1)
  • MACD above signal and histogram above 0: +2 (opposite: -2)
  • MACD bullish crossover: +1 (bearish crossover: -1)
  • RSI above 55: +1 (RSI below 45: -1)
  • ADX strong enough with +DI above -DI: +1 (with -DI above +DI: -1)
  • High-volume bullish candle: +1 (high-volume bearish candle: -1)
  • Higher-timeframe close above its EMA: +1 (below: -1)


Decision output
  • Score 5 or more: Strong Buy
  • Score 2 to 4: Buy
  • Score -1 to 1: Neutral
  • Score -2 to -4: Sell
  • Score -5 or less: Strong Sell

BUY and SELL labels appear when the score first enters strong territory. Bar colors follow the same ranges (stronger green for bullish, stronger red for bearish).

On-chart decision table rows
  • Decision - the combined decision and total score
  • Last Price and Bar Change - latest close and close-to-close move
  • O / H / L - current bar open, high and low
  • EMA 9 / EMA 21 and EMA 50 / EMA 200 - short and long trend references
  • MACD, RSI, ADX / DMI, Volume, HTF Trend - each confirmation's state and value
  • ATR - the risk unit
  • Long Plan and Short Plan - ATR-based stop and target reference levels

Read top to bottom: the Decision row is the summary; the rows below show which confirmations help or hurt. The plan rows are planning references only.

Inputs you can tune
  • EMA, MACD, RSI, ADX and volume lengths
  • ADX trend minimum and the score threshold
  • Higher-timeframe selection and EMA length
  • ATR length, stop multiplier and reward/risk for the planning levels
  • Display toggles for the table, labels and bar coloring


Notes
This indicator does not place orders. The risk rows are planning references, not entries or exits. Use it alongside your own analysis and risk management.

Clause de non-responsabilité

Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.