Long and Short Opening Strategy Based on Multi Timeframe Moving Average and MACD
Overview
This strategy takes full advantage of the functions of the multi timeframe exponential moving average (MTF EMA) to determine the trend direction and the MACD indicator to generate trading signals, while setting stop loss and take profit prices with the ATR indicator. The strategy is suitable for digital and fiat currency pairs with strong trends and performs better in markets with strong trends.
Strategy Principle
1. Trend Judgment Using MTF EMA
The multi timeframe exponential moving average (MTF EMA) can display moving averages of multiple timeframes on the same chart to determine the overall long/short status of an asset. This strategy adopts 1-hour and 15-minute MTF EMAs.
When the price is above the 1-hour MTF EMA and the 1-hour MTF EMA is below the 15-minute MTF EMA, it is defined as an uptrend. When the price is below the 1-hour MTF EMA and the 1-hour MTF EMA is above the 15-minute MTF EMA, it is defined as a downtrend.
2. MACD Generating Trading Signals
When the MACD line crosses above the Signal line from below, a buy signal is generated. When it crosses below from above, a sell signal is generated. At the same time, a crossover limit is set for the MACD line and Signal line to avoid false signals.
3. Setting Stop Loss and Take Profit with ATR
The ATR indicator is used to set stop loss and take profit prices. ATR can dynamically set reasonable stop loss and take profit distances based on market volatility. At the same time, the multiples of stop loss and take profit are set based on the backtest of highs and lows to make them more flexible.
Trading Strategy
Open Positions Signals
Long signal: Uptrend and MACD crossing above Signal line and crossover value less than limit
Short signal: Downtrend and MACD crossing below Signal line and crossover value greater than limit
Close Positions Signals
Long take profit: Price breaks through ATR take profit price
Long stop loss: Price breaks through ATR stop loss price
Short take profit: Price breaks through ATR take profit price
Short stop loss: Price breaks through ATR stop loss price
Advantage Analysis
The biggest advantage of this strategy is that it fully utilizes the strengths of the MTF EMA in determining trends and the MACD in generating trading signals. MTF EMA can clearly judge the overall trend direction and avoid frequent trading in choppy markets. The MACD indicator can better capture short-term changes in price patterns and generate trading signals. Using both together ensures capturing the trend while obtaining more trading opportunities. In addition, using the ATR indicator to dynamically track stop loss and take profit can effectively control the risk of individual trades.
Risks and Solutions
There are two main risks to this strategy: First, in the absence of a clear trend, MTF EMA may generate incorrect signals, leading to losses; Second, the MACD indicator often generates misleading signals when prices change dramatically, which can lead to over-trading. For the first risk, the MTF EMA parameters can be adjusted appropriately to better match price trend changes; The second risk can be mitigated by setting crossover limits for the MACD indicator.
Optimization Directions
The following aspects of the strategy could be optimized:
-
Adjust the cycle parameters of MTF EMA to match the price characteristics of different trading instruments better
-
Optimize the fast and slow moving average and signal line parameters of the MACD indicator for better signals
-
Test different ATR cycle parameters and stop loss/take profit multiples for the best returns
-
Add other auxiliary indicators to filter signals
Summary
This long and short opening strategy combines the methods of MTF EMA for trend judgment, MACD for trading signal generation, and ATR for dynamic stop loss and take profit. It can achieve good returns in markets with obvious trends. There is plenty of room for optimizing this strategy's parameters and optimization to achieve better performance. However, it is necessary to control risks and avoid blind trading in choppy markets.
/*backtest
start: 2023-12-01 00:00:00
end: 2023-12-31 23:59:59
period: 1h
basePeriod: 15m
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/
// © Steven A. Zmuda Burke / stevenz17
//@version=4
// From Date Inputs- 1

