ta-oliver / infertrade

Open source trading and investment strategy library designed for accessibility and compatibility
Apache License 2.0
34 stars 20 forks source link

Add new trading rule document: Moving Average Convergence Divergence (MACD) #160

Closed Cal231995 closed 3 years ago

Cal231995 commented 3 years ago

Moving average convergence divergence (MACD) is a trend-following momentum indicator that shows the relationship between two moving averages of a security’s price. The MACD is calculated by subtracting the 26-period exponential moving average (EMA) from the 12-period EMA.

Allocation Strategy The strategy is to identify bullish and bearish crossovers. Bullish crossover - when MACD line cross above the signal line Bearish Crossover - when Signal Line cross above the Macd line

The theory suggests that asset price momentum will continue or slow down base on the crossovers made:

if MACD line Value > signal line value then allocation = max_allocation if Signal Line value< lower than macd line value then allocation = max_allocation else: allocation = 0

https://www.investopedia.com/terms/m/macd.asp

Cal231995 commented 3 years ago

macd

Cal231995 commented 3 years ago

for documentation purposes @fhashim May be you can refer to this PR: https://github.com/ta-oliver/infertrade/pull/152