Type/to search

Dual MACD Quantitative Trading Strategy

Common strategy
Created: 2024-01-30 16:43:29
Last modified: 3 years ago
1
Follow
1802
Followers

img

Overview

The Dual MACD quantitative trading strategy is a quantitative trading strategy implemented using dual timeframe MACD indicators. It goes long when the weekly MACD indicator forms a golden cross and closes the position when the daily MACD indicator forms a death cross. When the position is empty, if the daily MACD indicator forms another golden cross, a new long position can be opened.

Strategy Logic

The Dual MACD quantitative trading strategy uses a combination of weekly MACD and daily MACD indicators to determine entry and exit signals.

Firstly, when the MACD line of the weekly MACD indicator crosses above the signal line, a buy signal is generated and a long position is opened. Then when the MACD line of the daily MACD indicator crosses below the signal line, a sell signal is generated and the position is closed.

When the position is empty, if the MACD line of the daily MACD indicator crosses above the signal line again, a new long position is reopened. That is to say, the golden cross of the daily MACD acts as the re-entry condition.

Note that only the death cross of the daily MACD will close the position, but reopening is only allowed when the MACD line of the weekly MACD is above the signal line, within the "Trading Window".

Advantages

The Dual MACD quantitative trading strategy combines dual timeframe analysis, which can effectively filter false signals and improve signal quality. Specifically, there are several main advantages:

  1. The weekly timeframe judges the main trend direction, which helps avoid contrarian trading.

  2. The daily timeframe determines entry and exit timing, which can timely capture short-term trading opportunities.

  3. The "Trading Window" mechanism can avoid excessively frequent opening and closing due to short-term adjustments.

  4. The MACD indicator parameters are adjustable and can be optimized according to different varieties and market conditions.

  5. Integrates take profit, stop loss, trailing stop loss functions to effectively control risks.

Risks

The Dual MACD quantitative trading strategy also has some risks, mainly including:

  1. MACD indicator tends to generate false signals and frequent crossovers, needs confirmation from other indicators.

  2. The main trend identified in weekly/monthly timeframe may reverse, trailing stop loss is necessary.

  3. Parameters need continuous optimization and adjustment according to varieties and market conditions.

  4. Cannot overly rely on backtest results, live performance may differ from backtest.

Corresponding solutions:

  1. Combine with other indicators to build strategy systems with logic optimization.

  2. Set reasonable stop loss to avoid exceeding maximum tolerable loss.

  3. Continuously optimize parameters to find optimal combinations.

  4. Start live trading from minimum capital to validate stability.

Optimization

The Dual MACD quantitative trading strategy has room for further optimization:

  1. Introduce Bollinger Bands, KDJ and other indicators to build multi-indicator combined strategies and improve signal quality.

  2. Incorporate trading volume indicators to avoid false breakouts with insufficient volume.

  3. Utilize machine learning methods to automatically optimize parameters and achieve dynamic adjustment.

  4. Further risk adjustment of the strategy, such as adding advanced stop loss methods like profit & loss ratio.

  5. Strategy fitness test & optimization to avoid overfitting problems.

Conclusion

The Dual MACD quantitative trading strategy integrates dual timeframe analysis to determine main and subordinate trends and gives full play to the advantages of each indicator. There is still great potential for strategy optimization, and it is expected to further improve strategy performance by introducing other indicators, automatic parameter optimization through machine learning, etc. Live trading verification is an indispensable step and important basis for further perfecting the strategy.

Source
Pine
/*backtest
start: 2023-01-29 00:00:00
end: 2024-01-11 05:20: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/
// © maxits

// Long Position: Weekly Macd line crosses above Signal line   
Strategy parameters
Strategy parameters
Start Time
Finish Time
------ Profit & Loss ------
Enable Just a Profit Level?
Enable Just a S.Loss Level?
Enable Only Trailing Stop
Take Profit %
Stop Loss %
Trailing Stop %
Trailing Stop Source
------ Macd Properties ------
Short Term TimeFrame
Long Term TimeFrame
Source
Fast Length
Slow Length
Sign Length
Daily or Weekly?
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)