Type/to search

Trend Following Strategy Based on Moving Average Combination

Common strategy
Created: 2024-02-23 14:54:34
Last modified: 2 years ago
1
Follow
1802
Followers

img

Overview

This strategy identifies trend directions by calculating combinations of multiple fast and slow moving averages. It generates buy signals when the fast MAs cross above the slow MAs, and sell signals when the fast MAs cross below the slow MAs.

Strategy Logic

  1. Calculate 7 groups of fast EMAs with periods of 3/6/9/12/15/18/21 days.
  2. Calculate 14 groups of slow EMAs with periods of 24/27/30/.../200 days.
  3. Set color rules for fast EMAs: 3MA above 6MA is uptrend (aqua), below is downtrend (orange).
  4. Set color rules for slow EMAs: 24MA above 25MA is uptrend (lime), below is downtrend (red).
  5. When fast EMA grupo crosses above slow EMA group, generate buy signal, indicating uptrend.
  6. When fast EMA grupo crosses below slow EMA group, generate sell signal, indicating downtrend.

By combining fast and slow MAs, it can effectively identify the change in medium- and long-term trends for position tracking.

Advantages

  1. Fast and slow MAs combined can strongly identify trend changes. Fast MAs capture short-term trends, and slow MAs filter consolidations.
  2. Multiple MAs combined can give clearer and more reliable signals, avoiding false signals.
  3. Flexible operating cycle by using different EMA periods.
  4. Long position tracking suits the mode of operation of most private funds.

Risks

  1. Holding positions for too long may miss short-term trading opportunities.
  2. EMA combinations are not suitable for catching sharp price fluctuations.
  3. Improper parameter settings may result in too frequent or conservative signals. Parameter testing and live verification are recommended.

Optimization Suggestions

  1. Add more fast EMAs to improve judgment of short-term trends.
  2. Add more slow EMAs to improve judgment of medium- and long-term trends.
  3. Add MA signal confirmation to reduce false signals.
  4. Incorporate volume analysis to avoid false breakouts in ranging markets.

Summary

This strategy identifies mid- to long-term trend changes by constructing fast and slow MA systems, which is a typical tracking position strategy. There is still much room for optimization in parameter selection and signal filtering. Investors can tailor it to adapt to different market conditions.

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

//@version=3
strategy("CM Super Guppy ala WY", pyramiding=1, default_qty_type=strategy.percent_of_equity, default_qty_value=99, overlay=true)

Strategy parameters
Strategy parameters
Backtest Start Year
Backtest Start Month
Backtest Start Day
Backtest Stop Year
Backtest Stop Month
Backtest Stop Day
Fast EMA 1
Fast EMA 2
Fast EMA 3
Fast EMA 4
Fast EMA 5
Fast EMA 6
Fast EMA 7
Slow EMA 8
Slow EMA 9
Slow EMA 10
Slow EMA 11
Slow EMA 12
Slow EMA 13
Slow EMA 14
Slow EMA 15
Slow EMA 16
Slow EMA 17
Slow EMA 18
Slow EMA 19
Slow EMA 20
Slow EMA 21
Slow EMA 22
EMA 200
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)