Type/to search

EMA Pullback Strategy

Common strategy
Created: 2023-12-21 11:48:54
Last modified: 3 years ago
1
Follow
1802
Followers

img

Overview

The EMA pullback strategy is a quantitative trading strategy based on the EMA indicator. It constructs trading signals using three EMA curves with different periods and sets stop loss and take profit based on price pullbacks to automate trading.

Strategy Principle

The strategy uses three EMA curves:

  • EMA1: for judging price pullback support/resistance level, with a relatively short period, default to 33 periods.
  • EMA2: for filtering some reversal signals, with a period of 5 times of EMA1, default to 165 periods.
  • EMA3: for determining overall trend direction, with a period of 11 times of EMA1, default to 365 periods.

Trading signals are generated according to the following logic:

Long signal: Price crosses above EMA1, pulls back below EMA1 forming higher lows, with pullback not reaching EMA2. Enter long when price crosses back above EMA1.

Short signal: Price crosses below EMA1, pulls back above EMA1 forming lower highs, with pullback not reaching EMA2. Enter short when price crosses back below EMA1.

Stop loss is set at the lowest/highest pullback price for long/short. Take profit is set at 2 times the stop loss.

Strategy Advantages

The strategy has the following advantages:

  1. Trading signals constructed using reliable EMA indicator.
  2. Price pullback avoids being trapped effectively.
  3. Stop loss set at previous high/low controls risk effectively.
  4. Take profit satisfying risk-reward ratio.
  5. EMA parameters adjustable for different cycles.

Strategy Risks

The strategy also has some risks:

  1. EMA has lagging effect, may miss trend reversal points.
  2. Pullback range too large exceeding EMA2 may generate false signals.
  3. Stop loss may be broken in trending markets.
  4. Improper parameter settings lead to over-trading or missing opportunities.

Risks can be mitigated by adjusting EMA periods, pullback limit etc. Other indicators can also be added to filter signals.

Optimization Directions

The strategy can also be optimized in the following aspects:

  1. Add trend indicator to avoid counter-trend trading, e.g. MACD.
  2. Add trading volume indicator to avoid false breakout, e.g. OBV.
  3. Optimize EMA periods or use adaptive EMA.
  4. Dynamically optimize parameters using machine learning models like bag-of-words.
  5. Add model prediction for adaptive stop loss and take profit.

Conclusion

The EMA pullback strategy constructs a trading system using three EMAs and sets stop loss and take profit based on price pullbacks to automate trading. It effectively controls trading risks and can be optimized by adjusting parameters based on market conditions. Overall the strategy has sound logic and can be applied in actual trading. Future improvements can be made in aspects like trend determination, parameter optimization and risk control.

Source
Pine
/*backtest
start: 2023-11-20 00:00:00
end: 2023-12-20 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/
// created by Space Jellyfish
//@version=4
Strategy parameters
Strategy parameters
Take Profit Stop Loss ratio
lowest risk per trade
highest risk per trade
EMA1 for pullback level Period
EMA2 for pullback limit Period
EMA3 for trend Period
Start Date
Start Month
Start Year
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)