OPEN-SOURCE SCRIPT

BRT MACD Custom

Updated
BRT MACD Custom — Adaptive and Flexible MACD for Multi-Timeframe Analysis

The BRT MACD Custom is an advanced version of the traditional MACD indicator, offering additional flexibility and adaptability for multi-timeframe trading. This custom script allows traders to adjust the calculation parameters for MACD to suit their specific trading strategy, timeframe, and market conditions.

snapshot

Key Features

  1. Multi-Timeframe Support
    Unlike the standard MACD, this indicator lets you choose a specific timeframe (different from the chart timeframe) for calculating MACD values. This feature provides more flexibility in analyzing market trends on multiple timeframes without changing the main chart.
    Example: You can analyze MACD on a 15-minute timeframe even when your chart is set to 1-minute, giving you broader market insights.
    snapshot
  2. Customizable EMA and Signal Settings
    Users can adjust the fast and slow EMA lengths as well as the signal smoothing to better align with their preferred trading strategies. The script allows switching between the two popular types of moving averages — SMA or EMA — for both the MACD and the signal line.

  3. Volatility-Based Adaptive EMA
    The script includes an adaptive mechanism for EMA calculation. When the selected timeframe closes, the indicator dynamically adjusts the calculation, ensuring the MACD values respond quickly to market volatility. This makes the indicator more reactive compared to static MACD implementations.

  4. Shift Options for MACD, Signal, and Histogram
    The indicator allows shifting the MACD, signal line, and histogram values by one or more bars. This can be useful for backtesting and simulating strategies where you anticipate future price movements.

  5. Signal Alerts for Long and Short Trades
    The script generates visual signals when certain conditions are met, indicating potential long or short trade opportunities. These signals are based on MACD and histogram crossovers:

  6. Long Signal: Triggered when MACD is above the signal line and both are rising.
  7. Short Signal: Triggered when MACD is below the signal line and both are falling.
    Custom Plotting
    The MACD line, signal line, and histogram are plotted on the chart for easy visualization. The histogram changes colors to reflect positive or negative momentum:

  8. Green shades when MACD is above the signal line.
  9. Red shades when MACD is below the signal line.


Applications in Trading
The BRT MACD Custom is ideal for traders who need flexibility in their technical analysis. Its multi-timeframe capabilities and customizable moving averages make it suitable for day trading, swing trading, and long-term investing across a variety of markets.

Scalping: Use the 1-minute or 5-minute timeframe to identify short-term trends while calculating MACD on a higher timeframe such as 15 or 30 minutes.
Swing Trading: Apply the indicator on 1-hour or 4-hour charts to detect mid-term trends.
Long-Term Investing: Analyze daily or weekly charts with longer EMA periods to confirm market direction before making large investments.
Release Notes
Update
Release Notes
Updated Version with Entry and Filter Condition for Strategy Builder
Release Notes
Refined signal logic for the Strategy Builder.
Moving Average Convergence / Divergence (MACD)multitimeframeOscillators

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


Also on:

Disclaimer