Type/to search

Swing Trend Moving Average Strategy

Common strategy
Created: 2024-02-04 15:44:54
Last modified: 2 years ago
1
Follow
1802
Followers

img

Overview

The Swing Trend Moving Average Strategy is a trend following system that uses a long-term moving average to identify the trend direction combined with the Average True Range to filter out fakeouts and limit overall drawdowns. It adopts an Exponential Moving Average to determine the trend direction and utilizes the Average True Range to detect if it is a false breakout. This can effectively filter out ranging markets and reduce overall strategy drawdowns.

Strategy Logic

The strategy is designed based on the following principles:

  1. Use an exponential moving average to determine the overall trend direction. The default period is 200 bars.
  2. Calculate the Average True Range over the last 10 bars.
  3. When the closing price is above "Moving Average + Average True Range", it is determined as an uptrend.
  4. When the closing price is below "Moving Average - Average True Range", it is determined as a downtrend.
  5. Go long in an uptrend and go short in a downtrend.
  6. By default, the moving average is used as the stop loss line. It can also choose to use "Moving Average ± Average True Range" as the stop loss line.

Advantage Analysis

The strategy has the following advantages:

  1. Using a moving average to determine the major trend can effectively filter out short-term market noise.
  2. Adding Average True Range as a filter condition avoids generating trading signals in ranging markets, thus reducing unnecessary losses.
  3. The stop loss line is close to the moving average or its reverse range, allowing quick stop losses to reduce maximum drawdown.
  4. Simple parameter settings make it easy to understand and optimize.

Risk Analysis

The strategy also has some potential risks:

  1. Trend reversal usually leads to some degree of drawdown in a moving average system.
  2. The parameter settings of the moving average and Average True Range can have a big impact on strategy performance. Improper parameter settings may miss trading opportunities or increase unnecessary losses.
  3. The strategy itself does not consider the relationship between price and volume. It may generate some false signals.

Optimization Directions

The strategy can be optimized in the following aspects:

  1. Test different types of moving averages to find the most suitable one for specific stocks or products.
  2. Optimize the moving average period parameter to make it more suitable for the characteristics of the traded stocks or products.
  3. Optimize the Average True Range parameter to find the best combination to filter ranging markets without missing trends.
  4. Add volume rules to avoid invalid breakouts.
  5. Test and compare different stop loss methods to determine the optimal solution.

Conclusion

Overall, the Swing Trend Moving Average Strategy is a very simple and practical trend following strategy. It also has good risk control. Although the strategy does not take many factors into consideration, detailed testing and optimization of parameters and stop loss methods are still required. However, its simple trading logic and parameter settings make it widely applicable to different products, especially suitable for trading cryptocurrencies like Bitcoin.

Source
Pine
/*backtest
start: 2023-01-28 00:00:00
end: 2024-02-03 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/
// © Inkedlau

//@version=5
Strategy parameters
Strategy parameters
Open Short Positions?
Exit trade on Moving Average Cross?
Source
Trend Length
Moving Average Type
ATR Threshold
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)