Moving Average Convergence-Divergence (MACD)
<< Click to Display Table of Contents >> Moving Average Convergence-Divergence (MACD) |
MACD uses moving averages, which are lagging indicators, to include some trend-following characteristics. These lagging indicators are turned into a momentum oscillator by subtracting the longer moving average from the shorter moving average.
... Courtesy of StockCharts
MACD(int fast, int slow, int smooth)
MACD(ISeries<double> input, int fast, int slow, int smooth)
Returns MACD value
MACD(int fast, int slow, int smooth)[int barsAgo]
MACD(ISeries<double> input, int fast, int slow, int smooth)[int barsAgo]
Returns average value
MACD(int fast, int slow, int smooth).Avg[int barsAgo]
MACD(ISeries<double> input, int fast, int slow, int smooth).Avg[int barsAgo]
Returns difference value
MACD(int fast, int slow, int smooth).Diff[int barsAgo]
MACD(ISeries<double> input, int fast, int slow, int smooth).Diff[int barsAgo]
double; Accessing this method via an index value [int barsAgo] returns the indicator value of the referenced bar.
fast |
The number of bars to calculate the fast EMA |
input |
Indicator source data (?) |
slow |
The numbers of bars to calculate the slow EMA |
smooth |
The number of bars to calculate the EMA signal line |
// Prints the current MACD value |
You can view this indicator method source code by selecting the menu New > NinjaScript Editor > Indicators within the NinjaTrader Control Center window.