OPEN-SOURCE SCRIPT

MACD Strategy

MACD Strategy - Trend Following with Crossover Signals

This strategy uses the MACD (Moving Average Convergence Divergence) to generate buy and sell signals based on the crossover of the MACD line and the Signal Line.

Key Features:
MACD Line (Blue): The difference between the 12-period and 26-period exponential moving averages (EMAs).
Signal Line (Orange): The 9-period EMA of the MACD line.
Histogram (Red): Displays the difference between the MACD line and the Signal line, helping visualize trend strength.
Buy & Sell Logic:
Buy Signal: Triggered when the MACD line crosses above the Signal line.
Sell Signal: Triggered when the MACD line crosses below the Signal line.
Strategy Execution:
Buy Position: The strategy enters a long position when the MACD line crosses above the Signal line.
Sell Position: The strategy closes the long position when the MACD line crosses below the Signal line.
This strategy is useful for identifying trend reversals and momentum shifts. The MACD crossover is a popular tool for trend-following traders looking to enter during strong trends and exit when momentum slows.

Moving Average Convergence / Divergence (MACD)

Script de código aberto

No verdadeiro espírito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam compreendê-lo e analisá-lo. Parabéns ao autor! Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Quer usar esse script no gráfico?

Aviso legal