Type/to search

Pullback Trading Strategy Based on Dynamic Moving Average

Cryptocurrency
Created: 2024-02-27 14:38:45
Last modified: 2 years ago
1
Follow
1781
Followers

img

Overview

This strategy employs a dual moving average system to identify potential breakout opportunities in selected stocks or cryptocurrencies. The core principle is to buy when the shorter-term moving average bounces back from below the longer-term moving average and sell when prices retest the longer-term moving average.

Strategy Logic

The strategy utilizes two simple moving averages (SMA) with different periods as trading signals. The first SMA has a longer period to represent the overall trend direction. The second SMA has a shorter period to capture short-term price fluctuations.

When the shorter-term SMA crosses above the longer-term SMA from below, it signals an uptrend in prices overall hence the strategy opens a long position. When prices pull back down to retest the longer-term SMA, it indicates the short-term pullback has ended and the strategy considers stopping out or taking profit on the position.

In addition, the strategy has “oversold” and “overbought” conditions to avoid trading in extreme situations. It only opens positions when both SMA crossover and reasonable valuation criteria are met.

Advantages

  • Dual moving average system effectively identifies medium-term trends
  • Combines the merits of trend following and pullback trading
  • Embedded oversold and overbought conditions reduce unnecessary trades

Risk Analysis

  • Difficult to determine precise pullback end timing, may stop out prematurely
  • Unable to quickly cut losses when trend changes, could suffer large drawdowns
  • Poor parameter tuning may result in over-trading or conservative trading

Optimization Directions

There is further room to optimize this strategy:

  1. Utilize more advanced technical indicators like Bollinger Bands and KD to gauge price waves and trends
  2. Incorporate more factors like volume change, volatility to determine pullback completion
  3. Dynamically size positions to maximize profit potential
  4. Optimize stop loss logic with KAMA, Ichimoku clouds and lower timeframe signals

Conclusion

This strategy combines the strengths of trend following and pullback trading using a dual moving average system to detect opportunities. At the same time, embedded overbought/oversold conditions avoid unnecessary position opening. It is a very practical quant trading strategy worth deeper research and optimization.

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

// @version=5
strategy("Profitable Pullback Trading Strategy", overlay=true,initial_capital=1000, default_qty_type=strategy.percent_of_equity, default_qty_value=100)

// Inputs
Strategy parameters
Strategy parameters
Moving Avg. Parameters
MA length 1
MA length 2
Stop Loss (%)
Too Deep and Thin conditions
Too Deep (%)
Too Thin (%)
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)