top of page
  • Erik Billerikay

Strategy Review | How to use the MACD indicator

Updated: Jan 24, 2021

#MACD #tradingstrategy

This article will go through step-by-step on how to use the MACD indicator to trade stocks. In particular, we included one profitable MACD trading strategies that you can start trading today. Moreover, If you are interested in generating and verifying strategy ideas, we have included the strategy's code in the end. So, make sure you read until the end.

Understanding the MACD indicator

“Moving average convergence divergence (MACD) is a technical indicator that was originally designed to be a trend-following momentum indicator. However, it can also be used to trade mean reversion”

MACD was created in the 1970s. It is a simple indicator that consists of two exponential moving averages of different length.

Calculating MACD

MACD is calculated by subtracting the slow EMA from the fast EMA. The default configuration for fast and slow EMA are 12 and 26, respectively.

Calculating The Signal line

The next is to calculate the signal line, which is usually the 9-day EMA. The signal line is sometimes used as a reversal signal.

A step-by-step guide to using the MACD indicator

“Follow the rules.”

1. Configure the MACD indicator with parameters of 9,5, and 11.

2. Condition 1: Fast EMA crosses over the Slow EMA.

3. Condition 2: Signal line below zero.

4. If condition 1 and 2 are satisfied, buy at the close.

5. Sell at the close when Slow EMA crosses over the Fast EMA.

Trade example

Strategy long term performance

The following test is conducted in the period between 2002 to 2020 on Invesco QQQ ETF. The software we use is #Amibroker.


Win Ratio: 72.48%

Average Profit % : 1.77%

Averageg Loss % : -2.79%

Profit Factor: 1.73

Sharpe Ratio: 0.67

Annual Return: 6.87%


This is a trend following / momentum strategy that works well on QQQ and SPY. This strategy performed very well during periods with high volatility in 2020. Let us know your thoughts and share with us your trading success!

Thanks for reading until the end. It would be our greatest honour if you can subscribe to our Youtube channel, become our site member or leave a comment below. It only takes you 2 mins and it will not cost you any money, but it is the greatest motivator for us to keep producing quality content to boost your trading success and continue doing what we love so much. Have a wonderful day!!


Code of this strategy in Amibroker for advanced traders.


fast_avg = 9;
slow_avg = 5;
Signal_period = 11;
fast = EMA(C,fast_avg)-EMA(C,slow_avg);
slow = EMA(fast,Signal_period);

Buy = Cross(fast, slow) and slow<0 ;
Sell = Cross(slow, fast);

Check out why we choose Amibroker

Check out our Youtube channel


We are not financial advisors. Please do your own due diligence and investment research or consult a financial professional. All articles are our opinion – they are not suggestions to buy or sell any securities.


Consider subscribing to our YouTube channel for more detailed analysis.

Thanks for supporting our work!

Consider subscribing to our YouTube channel for more detailed analysis.

Thanks for supporting our work!

bottom of page