Type/to search

MACD Moving Average Crossover Strategy

Cryptocurrency
Created: 2023-09-14 17:03:47
Last modified: 3 years ago
1
Follow
1781
Followers

Strategy Logic

This strategy combines the MACD indicator with moving averages, going long when both give aligned signals.

The logic is:

  1. Compute FAST MACD, typically 12-day EMA

  2. Compute SLOW MACD, typically 26-day EMA

  3. MACD is FAST minus SLOW

  4. Signal line is typically 9-day MA of MACD

  5. Compute 9-day and 26-day MAs

  6. Consider long when MACD crosses above signal line

  7. Go long when 9-day MA crosses above 26-day MA

  8. Close long when MACD crosses below signal line and 9-day MA crosses below 26-day MA

The strategy taps MACD’s overbought-oversold gauge and MA’s trend following ability, combining both for higher odds trades.

Advantages

  • MACD judges overbought/oversold, MA determines trend

  • Combination provides high-probability long opportunities

  • Clear rules easy to implement

Risks

  • Requires optimization to determine best parameters

  • LONG-only unable to use short opportunities

  • With-trend trades may magnify losses

Summary

This strategy utilizes MACD and MA’s strengths in judging market rhythm. But LONG-only limitations and parameter optimization warrant caution.

Source
Pine
/*backtest
start: 2023-09-06 00:00:00
end: 2023-09-13 00:00:00
period: 30m
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/


//@version=4
strategy("MACD Cross+MA", overlay=true)
//@version=4
Strategy parameters
Strategy parameters
Fast Length
Slow Length
Source
Signal Smoothing
Simple MA(Oscillator)
Simple MA(Signal Line)
From Year
From Month
From Day
To Year
To Month
To Day
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)