Type/to search

Dual Moving Average Trend Following Strategy

Cryptocurrency
Created: 2023-09-24 13:14:08
Last modified: 3 years ago
1
Follow
1781
Followers

Overview

This strategy uses long-term RMA and short-term EMA crossovers to determine trend direction. It trails recent highest high or lowest low for stop loss. There is also a no-trade zone around the RMA to avoid false breaks.

Strategy Logic

  1. Use long period RMA and short period EMA to determine trend. Short EMA crossing below long RMA signals downtrend. Crossing above signals uptrend.

  2. When price breaks above recent highest high over certain periods, trail the highest high as stop loss. When price breaks below recent lowest low, trail the lowest low as stop loss.

  3. Set a no-trade zone around the RMA. Do not open positions when price is within the zone to avoid whipsaws. Zone range is based on certain percentage of RMA value.

  4. Set take profit price to exit positions at a profit percentage after entry.

Advantages

  1. Dual moving average crossover reliably determines trend direction.

  2. Trailing stop loss moves with the trend.

  3. No-trade zone filters fake breakout signals.

  4. Take profit allows strategy to actively close profitable trades.

Risks

  1. Delay in moving average crossovers may increase losses.

  2. Stop loss too close to price may get stopped out by noise.

  3. No-trade zone too wide may miss opportunities.

  4. Not stopping out in time can lead to further losses.

Possible Solutions:

  1. Optimize moving average parameters to reduce delay.

  2. Widen stop loss slightly to prevent oversensitivity.

  3. Test adjusting no-trade zone range to avoid missing trades.

  4. Add other stop loss mechanisms to limit max loss.

Optimization Directions

  1. Test other moving average combinations for better fit.

  2. Add spread, MACD etc to improve stability.

  3. Use machine learning to optimize parameters intelligently.

  4. Incorporate trend strength to avoid counter-trend trades.

  5. Optimize money management for higher win rate.

Summary

This strategy uses dual moving average crossovers to determine trend direction and combines trailing stops and no-trade zones to lock in trend profits. The framework is simple and extensible. It can be improved by adjusting parameter ranges, optimizing exits, and incorporating additional filters and signals to make it robust across different markets.

Source
Pine
/*backtest
start: 2023-08-24 00:00:00
end: 2023-09-12 00:00:00
period: 3h
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/
// © PatrickGwynBuckley

//@version=5
Strategy parameters
Strategy parameters
quick ma's
long ma's
leverage
Highest high period
Lowest low period
no trade zone
take profit %
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)