MACD is a popular technical indicator that was developed by Gerald Appel in the 1970s. It is used to indicate changes in the momentum, direction and duration of an underlying asset’s price action. MACD focuses on the relationship between two moving averages. The first is called MACD line which it is calculated by subtracting the 26 periods EMA (exponential moving average), from the 12 periods EMA. The second line is known as the signal line, this is a 9 period EMA of the MACD line. Both the MACD line and the signal line are plotted over current price action, and the difference between them is presented in a histogram beneath the chart being monitored. MACD works best in trending markets as its main strength is alerting traders to subtle changes in the strength and direction of an asset’s trend. There are three main things MACD traders look out for when using this technical indicator.
On-Screen Buy & Sell Signals
The indicator displays on the screen Buy or Sell on the bottom right-hand side of the indicator window when the following conditions apply as described below. It also provides signals to be used in your own trading robots.
IsBullish Signal Condition
MACD > Signal & MACD < 0 & Histogram > 0
IsBearish Signal Condition
MACD < Signal & MACD > 0 & Histogram < 0
Usage with cBots
If you reference this indicator from your cBot you can use the IsBullish and IsBearish properties to determine an additional signal to help you buy or sell.
ClickAlgoFastMACD macdFast= Indicators.GetIndicator(source, longCycle, shortCycle, periods, false);
Now use this as follows in your robots.
// forces loading hma object with values
double i = macdFast.result.LastValue;
if (macdFast.IsBullish) // Only BUY
if (macdFast.IsBearish) // Only SELL
The Image below shows the Fast MACD compared to the default standard MACD formula.
The MACD indicator is special because it brings together momentum and trend in one indicator. This unique blend of trend and momentum can be applied to daily, weekly or monthly charts. The standard setting for MACD is the difference between the 12 and 26-period EMAs.
Do you want to create a trading robot using this indicator?
We can help, we offer a professional programming service?
Contact Us Today