EintSimple Pullback Strategy
Moving Average Crossover EintSimple Pullback Strategy
Overview
The EintSimple Pullback Strategy is a mean reversion strategy based on dual moving average crossover. It first uses a long-term and a short-term moving average line. When the short-term moving average line breaks through the long-term moving average line from the bottom, a buy signal is generated. To filter false breakouts, this strategy also requires the close price to be higher than the long-term moving average line.
After entering the market, if the price falls back below the short-term moving average line again, it will trigger an exit signal. In addition, this strategy also sets a stop loss exit. If the retracement from the highest point reaches the set stop loss percentage, it will also exit positions.
Strategy Logic
The strategy mainly relies on the golden cross of dual moving averages to determine entry timing. Specifically, the following conditions must be met at the same time before opening a position to go long:
- The close price is greater than the long-term moving average ma1
- The close price is lower than the short-term moving average ma2
- There is currently no position
After meeting the above conditions, this strategy will take a full long position.
The exit signal judgment is based on two conditions. One is that the price falls back below the short-term moving average again. The other is that the retracement from the highest point reaches the set stop loss percentage. The specific exit conditions are as follows:
- The close price is greater than the short-term moving average ma2
- The retracement from the highest point reaches the set stop loss percentage
When either exit condition is met, this strategy will close all long positions.
Advantages
-
Using dual moving average crossover combined with solid close prices to judge can effectively filter false breakouts.
-
Adopting pullback entry can enter after the price forms short-term inflection points.
-
With stop loss setting, it can limit the maximum drawdown.
Risks
-
Dual moving average crossover strategies tend to produce frequent trading signals and may chase peaks and kill bottoms.
-
Improper parameter settings of moving averages may result in overly smooth or overly sensitive curves.
-
Overly loose stop loss settings will lead to enlarged losses.
Optimization
-
Test different length combinations of long-term and short-term moving averages to find the optimal parameters.
-
Compare the effects of using close price and typical price to determine moving average crossovers.
-
Test adding filters like volume or volatility indicators.
-
Backtest optimize the stop loss percentage to find the best setting.
Conclusion
The EintSimple Pullback Strategy is a simple and practical dual moving average pullback strategy. It effectively utilizes the directional functionality of moving averages while combining solid close prices to filter out false signals. Although this strategy is prone to frequent trading and chasing peaks and killing bottoms, it can be further improved through parameter optimization and adding filters. Overall, this is a great strategy for quantitative trading beginners to practice on and optimize.
/*backtest
start: 2023-12-01 00:00:00
end: 2023-12-31 23:59:59
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/
// © ZenAndTheArtOfTrading / www.PineScriptMastery.com
// @version=5
strategy("Simple Pullback Strategy", - 1

