Enhance Your Trading with the MACD and Momentum Indicator for MetaTrader 4

Mike 2015.10.29 19:31 19 0 0
Attachments

Author: João Nunes @ neskk.com - 2015

If you're looking to elevate your trading game, the traditional MACD indicator paired with a Momentum indicator and alarms is the way to go. This tool not only allows for customization of various parameters but also keeps it beginner-friendly, so you won’t need to wrestle with complex code.

This MACD indicator is designed with simplicity in mind. Here’s how it works:

  • MACD Line: Calculated as FastEMA - SlowEMA
  • Signal Line: A 9-day EMA of the MACD
  • Histogram: The difference between the MACD and the Signal line

The Momentum line is derived by comparing two MACD values with a 10-bar gap in between. To keep things smooth, this Momentum is passed through a Moving Average.

As MACD zero-crossovers and Momentum reversals can be crucial indicators for traders, I’ve built in two alarms—one for each signal. Just a heads up: these alarms show up in the Experts tab. If you want them to pop up as alerts, simply uncomment the relevant lines in the code. Use Alert() instead of Print() to get those notifications!

I aimed to make this indicator as user-friendly and customizable as possible. Here’s what you can tweak:

  • BarsToProcess: This parameter is straightforward but crucial. Keep in mind that setting it to 1000 allows you to view up to 1D timeframes!
  • AppliedPrice: The price used in the MACD calculations.
  • PeriodFastEMA: The period for the fast moving average.
  • PeriodSlowEMA: The period for the slow moving average.
  • PeriodSignal: The period for analyzing the signal line.
  • SignalMA: The method for calculating the signal line's moving average.
  • DeltaMomentum: The distance between two points used for calculating Momentum.
  • PeriodMomentum: The period to compute the smoothed Momentum moving average.
  • MomentumMA: The method for calculating the smoothed Momentum's moving average.
  • AlarmZeroCrossover: Enable or disable the alarm for MACD zero-crossovers.
  • AlarmMomentumReverse: Enable or disable the alarm for Momentum reversals.

neskk-macd-graph

List
Comments 0