Type/to search

Multi-Period Moving Average Channel Trend Following Strategy

Common strategy
Created: 2024-02-20 13:45:42
Last modified: 2 years ago
1
Follow
1802
Followers

img

Overview

This is a swing strategy designed for trending markets such as crypto and stocks, using large timeframes like 8 hours. The strategy uses multiple moving averages including SMA, EMA, VWMA, ALMA, SMMA, LSMA and VWMA applied separately to high and low to form two average lines as a channel.

Go long when close is above the average line applied to high. Go short when close is below the average line applied to low.

Strategy Logic

The strategy uses 7 different types of moving averages including SMA, EMA, VWMA, ALMA, SMMA, LSMA and VWMA. These MAs are applied separately to the highest and lowest prices of candlesticks to generate two average lines.

The average line applied to high prices is called avg_high. The one applied to low prices is called avg_low. These two lines form a channel.

Go long when close is above avg_high. Go short when close is below avg_low.

The stop loss for long is avg_low. Take profit is entry price *(1 + tp_long). For short, stop loss is avg_high, take profit is entry price *(1 - tp_short).

Advantage Analysis

The biggest advantage of this strategy is utilizing multiple moving averages to improve profitability. Different MAs have different reaction speeds to price changes. Combining them forms more reliable trading signals.

Another advantage is the channel approach. The channel limits stop loss range and reduces risk suitable for swing trading.

Risk Analysis

The strategy has two main risks:

  1. The combination of multiple MAs makes parameter tuning complex requiring lots of tests and optimization to find the best.

  2. In sideways or non-trending markets, the strategy tends to generate losses and whipsaws.

To mitigate the risks, choose products with clear trends, and do extensive backtests and optimization to find parameters suitable for current market conditions.

Optimization Directions

Areas for further optimization:

  1. Test more types of MAs to find better combinations, like SMA, EMA, KAMA, TEMA etc.

  2. Optimize lengths of MAs and channel width to determine optimum parameters.

  3. Test different take profit and stop loss mechanisms like trailing stops or dynamic stops.

  4. Incorporate trend metrics like ADX, ATR to avoid whipsaws during choppy markets.

  5. Optimize entry and exit logics with additional filters to reduce invalid trades.

Summary

This swing trend following strategy improves profitability using multiple MAs and reduces risk via channels. It works well for trending products after parameter optimization. But can suffer big losses at trend reversals. Further optimizations needed to mitigate downside risks.

Source
Pine
/*backtest
start: 2024-01-20 00:00:00
end: 2024-02-19 00:00:00
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/
// © exlux99

//@version=4
Strategy parameters
Strategy parameters
From Day
From Month
From Year
To Day
To Month
To Year
Length Moving averages
TP Long
SL Long
TP Short
SL Short
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)