Skip to content

f-lsq/macd-trend-reversal-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MACD Trend Reversal Trading System

This is a simple moving average convergence/divergence (MACD) script that allows investors to

  1. Identify the market entry points for buying or selling
  2. Compare their profit or losses from buying and selling based on the MACD signals to a simple buy-hold-sell position based on historical financial data.

Background

Two Computation Methods

One of the two methods can be selected to compute the MACD histogram.

Methods Formula Assumptions
Simple Moving Average (SMA) SMA Formula
Exponential Moving Average (EMA) EMA Formula EMA Assumptions

MACD Line and Implications

The MACD line is calculated as follow: MACD Line Formula

which is used to calculate the signal line: Signal Line Formula

The signal line serves as a trigger for buy and sell signals. When the signal line crosses

  • Over the MACD line, a buy signal will be indicated.
  • Under the MACD line, a sell signal will be indicated.

Historical Financial Data

3 stock exchanges' historical financial datas are provided for computation.

  1. CAC40 for the period of 1998 to 2021
  2. FTSE100 for the period of 1998 to 2021, and
  3. SPY for the period of 2016 to 2021

Demonstration

Simple Moving Average

SMA Demonstration

Exponential Moving Average

EMA Demonstration

About

Simple script to compute the moving average convergence/divergence.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages