OPEN-SOURCE SCRIPT

MACD Classic

MACD Classic (Meta4)
This is a Classic MACD indicator designed to replicate the MetaTrader 4 (MT4) version of MACD, featuring clean visuals and dynamic histogram coloring for enhanced usability. Developed with simplicity and precision in mind, this script provides traders with an effective tool to analyze trends and momentum in the market.

Key Features:
Classic MACD Calculation:
Based on the difference between the fast and slow exponential moving averages (EMAs), with a signal line derived from the smoothed EMA of the histogram.

Dynamic Histogram Colors:
The histogram changes its color dynamically to reflect momentum changes:

Green Shades: Positive momentum (above zero) with increasing or decreasing strength.
Red Shades: Negative momentum (below zero) with increasing or decreasing strength.
Signal Line and MACD Line:

The Signal Line (red) provides smooth trend guidance.
The MACD Line (green or red) adapts to the trend direction, giving visual cues for bullish or bearish conditions.
Zero Line Reference:
A zero line is plotted to help you quickly identify trend reversals.

How to Use:
Analyze Trends:

When the MACD Line is above the zero line, the market is in a bullish trend.
When the MACD Line is below the zero line, the market is in a bearish trend.
Generate Buy/Sell Signals:

Buy: When the MACD Line crosses above the Signal Line.
Sell: When the MACD Line crosses below the Signal Line.
Monitor Momentum:

Use the histogram's color and size to gauge the momentum strength and its shifts.
Inputs:
Fast Length: Number of periods for the fast EMA (default: 12).
Slow Length: Number of periods for the slow EMA (default: 26).
Signal Smoothing: Number of periods for the Signal Line smoothing (default: 9).
Source: Input data for calculations (default: close price).
Advantages:
Seamlessly replicates the MetaTrader 4 MACD indicator for familiarity.
Dynamic coloring enhances visualization of market conditions.
Suitable for all timeframes and asset classes.
About the Developer:
This indicator was created by Mohammad reza Deramami, a dedicated trader and developer aiming to provide simple yet powerful tools for the TradingView community. If you find this indicator helpful, feel free to leave feedback or suggestions!
Moving AveragesOscillatorsTrend Analysis

开源脚本

本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受网站规则约束。 您可以收藏它以在图表上使用。

想在图表上使用此脚本?

免责声明