Type/to search

MACD Quantitative Trading Strategy

Cryptocurrency
Created: 2023-12-19 15:11:57
Last modified: 3 years ago
1
Follow
1782
Followers

img

Overview

This strategy uses the MACD indicator to build long position trading signals when the MACD is below a certain level to take advantage of mean reversion opportunities.

Strategy Logic

A long signal is generated when the MACD line is below the SIGNAL line and the absolute value of MACD is below -0.00025. After taking a long position, if the MACD line crosses above the SIGNAL line again, the position will be closed.

This strategy utilizes the MACD indicator to detect oversold zones. According to the theory of moving averages, there is a probability of mean reversion in the short term, and a long signal is established based on this probability.

Advantages

  1. Utilizes the MACD indicator to judge oversold levels, which has a certain reliability.
  2. Simple trading signals and rules that are easy to implement.
  3. Long holding periods means less frequent trading, reducing transaction costs and slippage.

Risks

  1. Risk of failed mean reversion. It will lead to losses if no reversion happens.
  2. Invalid signals from poor MACD parameter selection.

This risk can be reduced through parameter optimization.

Enhancements

  1. Optimize MACD parameters to find best combinations.
  2. Test different holding periods to find optimal duration.
  3. Add stop loss mechanisms.

Summary

This strategy utilizes the probability of mean reversions from oversold levels identified by the MACD indicator to generate long signals, and profits through long holding periods. Optimizing MACD parameters and adding stop losses improves reliability. In summary, it uses relatively simple indicators and rules to construct an easy to understand and implement quantitative strategy.

Source
Pine
//@version=3
strategy(title="MACD - EURUSD", shorttitle="MACD EURUSD")

// Getting inputs
fast_length = input(title="Fast Length",  defval=12)
slow_length = input(title="Slow Length",  defval=26)
src = input(title="Source", defval=close)
signal_length = input(title="Signal Smoothing",  minval = 1, maxval = 50, defval =9)
sma_source = input(title="Simple MA(Oscillator)", type=bool, defval=false)
sma_signal = input(title="Simple MA(Signal Line)", type=bool, defval=false)

// Plot colors
Strategy parameters
Strategy parameters
Fast Length
Slow Length
Source
Signal Smoothing
Simple MA(Oscillator)
Simple MA(Signal Line)
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)