Type/to search

Multi-timeframe MACD Trend Following Strategy

Common strategy
Created: 2024-01-23 12:08:40
Last modified: 3 years ago
1
Follow
1802
Followers

img

Overview

This is a multi-indicator combined strategy centering on the MACD indicator. It integrates 5 types of MACD trading signals and 5 types of moving averages. The strategy makes full use of the trend judgment capability of MACD to set different trading conditions for filtering out wrong signals, thereby obtaining higher profit probabilities.

Strategy Name

Multi-timeframe MACD Trend Following Strategy

Strategy Logic

The core of this strategy relies on the MACD indicator to determine the trend direction. The MACD is formed by the fast line (12-day EMA) minus the slow line (26-day EMA). The moving average of MACD itself is the signal line. The fast line crossing above the slow line gives a buy signal, while the fast line crossing below the slow line gives a sell signal.

The strategy has set 5 trading conditions:

  1. Simple golden cross and death cross signals
  2. Combine the overbought/oversold area of MACD to filter out some false signals
  3. Require close price above moving average upon golden cross to entry
  4. Require close price above moving average zone upon golden cross to entry
  5. Require RSI indicator above a certain level upon golden cross to entry

At the same time, the strategy also provides 5 types of moving averages (EMA, SMA, VWMA, RMA, WMA) and customizable parameter settings.

Advantages

  • Utilize the trend determination capability of MACD, multiple trading conditions filter false signals and improve profit probabilities
  • Built-in multiple types of moving averages, can flexibly adapt to different products
  • Customizable parameter settings, high adaptability
  • Multiple conditions for entry, avoid risks from relying on single indicator
  • Strong trend tracking capability, suitable for medium-long term operations

Risks

  • MACD itself has the risk of losses in range-bound markets
  • Does not consider the impact of sudden events like significant negative news
  • Improper parameter settings may lead to poor strategy performance
  • No stop loss function may lead to greater losses

Methods like adjusting parameters properly, setting stop loss, combining other indicators can help reduce risks.

Optimization Directions

The strategy can be optimized in the following aspects:

  1. Optimize moving average parameters for adapting different trading products
  2. Optimize MACD parameters for getting more precise trading signals
  3. Add stop loss mechanisms to avoid impacts from market sudden events
  4. Combine with other indicators like KDJ, Volatility Index to improve strategy performance
  5. Add machine learning algorithms to auto optimize parameter settings
  6. Conduct backtesting over longer time period

Conclusion

In general, this is a very practical trend following strategy. By utilizing the advantages of MACD and setting different trading conditions to filter wrong signals, it captures high-probability trading opportunities. Also, the customizable parameters and indicators make it highly adaptive. Notably, no strategy can perfectly predict the market. Continuous adjustment and optimization based on practical situation are needed to obtain long-term stable excess returns.

Source
Pine
/*backtest
start: 2023-01-16 00:00:00
end: 2024-01-22 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © HamidBox

Strategy parameters
Strategy parameters
MACD Fast
MACD Slow 
Signal Line
Source      
Oscilattor 
Signal       
Start Time                           
End Time                          
CHOOSE YOUR DESIRE SIGNAL
Stgy №1:👉 MACD CrossOver
Stgy №2:👉 MACD + OverBought 
MACD_OB_LVL
Stgy №3:👉 MACD + Close         
MA_signal_len
MA_signal_type
Stgy №4:👉 MACD + MA-ZONE    
MA_zone_len
MA_zone_type
Stgy №5:👉 MACD + RSI-OB
Length
Entry
No-Entry
🚦🚦macd Width & Colors setting🚦🚦
MACD Line               
MACD_color_High
MACD_color_Low
Signal Line               
signalLine_col_hi
signalLine_col_lo
Histogram        
BuyStrongHist
BuyWeakHist
SellStrongHist
Cross               
macd_cross_width
dot_crsovr_col
dot_crsndr_col
Zone Color        
zone_crsovr_col
zone_crsndr_col
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)