How to calculate MACD monthly?

Gents … I have to calculate MACD values on a monthly base. … does anybody have an idea how to implement?

(with the technical API - i only can get the daly values)
eodhd.com/api/technical/AAPL.US?order=d&from=2017-08-01&to=2020-01-01&function=sma&period=50&api_token=63920d17c30b17.18888403&fmt=json

Thanks
Stefan

MACD is 12-period EMA minus 26-period EMA (What Is MACD?).

Based on that, just calculate an EMA using the close price on the first of each month for each case and calculate the difference.

2 Likes

Bonjour, Stefan

moi j’utile les historiques DAT comme ceci!

Copyright © 2000-2018 Steven B. Achelis and Jon C. DeBry
MACD
Whirlpool
The calculation of the MACD is usually described as “subtracting the value of a 26-day exponential moving average from a 12-day exponential moving average.” That description is very close and it is how I usually describe the calculation of the MACD, but it isn’t precise.
Exponential moving averages are calculated by adding a percentage of today’s price to a percentage of the previous day’s exponential moving average. The percentages are determined from the number of periods (e.g., days) using the following formula:
exponential percentage = 2 / (number of periods + 1)
Given this formula, the percentage for a 12-day exponential moving average is 15.3846 percent and the percentage for a 26-day moving average is 7.4074 percent (these numbers actually have more digits, but I truncated them at 4 decimal places in this sentence). However, Appel originally defined the MACD as 15 percent and 7.5 percent exponential moving averages—slightly different from the percentage calculated using the above formula. Yes, the numbers are extremely close to those obtained by subtracting a 26-day exponential moving average from a 12-day exponential moving average, but the true MACD is calculated by subtracting a 15 percent exponential moving average from a 7.5 percent exponential moving average, which is the calculation below.