OPEN-SOURCE SCRIPT
Aggiornato

Moneyball EMA-MACD indicator [VinnieTheFish]

11 017
Summary of the Moneyball EMA-MACD Indicator Script

Author: VinnieTheFish

Purpose:
This indicator helps traders identify trend direction, momentum shifts, and potential trade signals based on EMA and MACD crossovers.

This Pine Script is a custom indicator that combines Exponential Moving Averages (EMAs) and MACD (Moving Average Convergence Divergence) to analyze price trends and momentum. The script uses a custom 9/50 MACD with a 16 smoothing period. The script is written in a way that you can create your own custom MACD settings and create alerts based on those parameters. The chart bars are color coded based on the relative position of the MACD and Signal line primarily for bullish long trade setups.

Bar color coding helps the trader spot potential reversals based on where the price currently resides in relation to the custom 9/50 EMA based MACD and the 16 period smoothing period for the signal line. Indicator also has custom alerts to notify the trader when a potential trade setup exists that correspond with the bar color change.

Question: So why is this called the Moneywell EMA-MACD Indicator?

Answer: In the movie Moneyball the Oakland A's broke down how to win a championship based on data. To make the playoffs you needed so many wins, then broken down by runs and then broken down to base hits. A base hit was good as a walk. With trading often times we look too often for home runs and ignore the importance of getting on base with small wins. This indicator was designed on shorter timeframes to identify those base hits, but can also be adapted to higher timeframes for swing trading.

Key Features:

User Inputs:

  • Configurable fast and slow lengths for MACD calculation.
  • Choice between SMA and EMA for oscillator and signal line smoothing.
  • Customizable signal smoothing length.


EMA Calculation:

  • Computes 3 EMA, 9 EMA, 20 EMA, and 50 EMA to track short-term and long-term trends.


MACD Calculation:

  • Computes MACD using either SMA or EMA based on user selection.
  • Generates the MACD signal line for comparison.


Crossover Conditions:

  • Detects MACD and Signal line crossovers above and below the zero line.
  • Identifies price momentum shifts.


Bar Coloring Logic:

  • Green: MACD is above 0 and above the signal line.
  • White: MACD is below the signal line.
  • Orange: MACD is below 0 but above the signal line.
  • Fuchsia: Bullish EMA 3/9 cross but price is still below the 20/50 EMA.


Alerts for Key Trading Signals:

  • MACD crossing above/below the zero line.
  • Signal line crossing above/below the zero line.
  • MACD reaching new highs/lows.
  • Alerts for colored bar conditions.
Note di rilascio
Summary of the Moneyball EMA-MACD Indicator Script

Author: VinnieTheFish

Purpose:
This indicator helps traders identify trend direction, momentum shifts, and potential trade signals based on EMA and MACD crossovers.

This Pine Script is a custom indicator that combines Exponential Moving Averages (EMAs) and MACD (Moving Average Convergence Divergence) to analyze price trends and momentum. The script uses a custom 9/50 MACD with a 16 smoothing period. The script is written in a way that you can create your own custom MACD settings and create alerts based on those parameters. The chart bars are color coded based on the relative position of the MACD and Signal line primarily for bullish long trade setups.

Bar color coding helps the trader spot potential reversals based on where the price currently resides in relation to the custom 9/50 EMA based MACD and the 16 period smoothing period for the signal line. Indicator also has custom alerts to notify the trader when a potential trade setup exists that correspond with the bar color change.

Question: So why is this called the Moneywell EMA-MACD Indicator?

Answer: In the movie Moneyball the Oakland A's broke down how to win a championship based on data. To make the playoffs you needed so many wins, then broken down by runs and then broken down to base hits. A base hit was good as a walk. With trading often times we look too often for home runs and ignore the importance of getting on base with small wins. This indicator was designed on shorter timeframes to identify those base hits, but can also be adapted to higher timeframes for swing trading.

Key Features:

User Inputs:

  • Configurable fast and slow lengths for MACD calculation.
  • Choice between SMA and EMA for oscillator and signal line smoothing.
  • Customizable signal smoothing length.
  • Added configurable bar coloring options and ability to deselect bar coloring
  • Added the ability to enable Red bars if desired (optional) based on community feedback.


EMA Calculation:

Computes 3 EMA, 9 EMA, 20 EMA, and 50 EMA to track short-term and long-term trends (used for Fuchsia bar)

MACD Calculation:

  • Computes MACD using either SMA or EMA based on user selection.
  • Generates the MACD signal line for comparison.


Crossover Conditions:

  • Detects MACD and Signal line crossovers above and below the zero line.
  • Identifies price momentum shifts.


Bar Coloring Logic:

  • Green: MACD > Signal line when MACD > 0
  • Orange: MACD > Signal line when MACD < 0
  • White: MACD < Signal Line
  • Fuchsia: Bullish EMA 3/9 when price is below 20 and 50 EMA and MACD < 0 (Early warning signal for Orange Bar)
  • Red: (Optional) MACD < Signal when MACD < 0


Alerts for Key Trading Signals:

  • MACD crossing above/below the zero line.
  • Signal line crossing above/below the zero line.
  • MACD reaching new highs/lows.
  • Alerts for colored bar conditions.


Changelog:
Feb 12, 2025 - published initial 1.0 version of the script
Mar 23, 2025 - added ability to customize colors & enable optional red bars when MACD < Signal line and MACD < 0 based on community feedback.
Note di rilascio
Added MACD & Signal line calculations to support SMA, EMA, DEMA and TEMA options. Previous version of indicator only had support for SMA and EMA.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.