The main idea of this strategy is to use both the Parabolic SAR and EMA indicators to identify the trend direction and timing of entering the market. Parabolic SAR is used to determine the current trend direction, and EMA is used to assist in determining the specific timing of entering the market. When SAR is above price, it is a bear market. When SAR is below price, it is a bull market. When entering the market, it also requires the price to break through the EMA before the trend is considered to be forming. At this time, follow the trend direction to enter the market.
The core indicator of this strategy is Parabolic SAR, which is a technical analysis tool that can track prices and judge trend reversals. Its calculation formula is more complicated, but the principle is simple and intuitive. The SAR indicator constantly adjusts its position to always stay behind the price. When the price reverses, it will immediately adjust its position to the other side of the price. Therefore, just observe the position of the SAR indicator relative to the price to judge the current trend direction.
Another indicator assisting this strategy is EMA. Unlike SAR, EMA is more suitable for judging the sustainability of trends. By requiring the price to break through the EMA before entering the market, some noise can be effectively filtered out. And EMA can also be used to confirm reversal signals. For example, when the price breaks through the rising trend EMA, it is likely to be a signal of trend reversal.
In summary, the specific trading rules of this strategy are as follows:
By determining the major trend through Parabolic SAR and filtering misleading signals with EMA, it is possible to lock in the trend while controlling risk and achieving effective trend tracking.
This strategy has the following main advantages:
In general, this strategy integrates the advantages of multiple indicators, while capturing the trend it also achieves effective risk control, and it is a stable trend tracking strategy that is easy to master.
Although the strategy has many advantages, there are still certain risks that need to be guarded against during actual operation. The main risks are:
To reduce the above risks, optimization can be carried out in the following aspects:
To further optimize this strategy, consider the following aspects:
Optimize parameter settings. Methods such as genetic algorithms can be used to test and optimize the parameters of EMA and SAR to find the optimal parameter combination.
Add trend judgment tools. Other indicators such as MACD and Bollinger Bands can be added to confirm the trend and improve accuracy.
Set dynamic stop loss. Set dynamic stop loss points based on indicators such as ATR for more flexible stops.
Consider trading costs. Introduce slippage and commission parameters to optimize net profits rather than absolute returns.
Multi-level entry and exit. More complex multi-level entry and exit mechanisms can be set to build positions or stop losses in stages at different trend stages.
With the above optimizations, while tracking the trend, the strategy can be expected to obtain higher stability, more accurate judgment and stronger risk control capabilities, thereby achieving melhor performance.
The Parabolic SAR and EMA trend tracking strategy integrates the advantages of multiple indicators to judge trend direction and timing of entry. With SAR set as stop loss point, risk is under control. It is a relatively stable quantitative strategy. This strategy has advantages such as high judgment accuracy and easy mastery. But there are also certain risks. Further optimization of parameters and stop loss methods is needed to achieve melhor performance. It is worth investors’ reference and learning.
/*backtest start: 2022-12-15 00:00:00 end: 2023-12-21 00:00:00 period: 1d basePeriod: 1h exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=3 strategy("Parabolic SAR Strategy w/ EMA", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100) emalength = input(100 , "EMA Length") emaoffset = input(0.00, "EMA Offset %") start = input(0.015) increment = input(0.005) maximum = input(0.2) //////////////////////////////////////////////////////////////////////////////// // BACKTESTING RANGE // From Date Inputs fromDay = input(defval = 1, title = "From Day", minval = 1, maxval = 31) fromMonth = input(defval = 1, title = "From Month", minval = 1, maxval = 12) fromYear = input(defval = 2019, title = "From Year", minval = 1970) // To Date Inputs toDay = input(defval = 1, title = "To Day", minval = 1, maxval = 31) toMonth = input(defval = 1, title = "To Month", minval = 1, maxval = 12) toYear = input(defval = 2020, title = "To Year", minval = 1970) // Calculate start/end date and time condition startDate = timestamp(fromYear, fromMonth, fromDay, 00, 00) finishDate = timestamp(toYear, toMonth, toDay, 00, 00) time_cond = true //////////////////////////////////////////////////////////////////////////////// psar = sar(start, increment, maximum) ema = ema(close, emalength) offset = (emaoffset / 100) * ema // Signals psar_long = high[1] < psar[2] and high > psar[1] psar_short = low[1] > psar[2] and low < psar[1] // Plot PSAR plotshape(psar, location = location.absolute, style = shape.cross, size = size.tiny, color = low < psar[1] and not psar_long ? green : red) //Plot EMA plot(ema) if(psar_long) strategy.close("Short") if(psar_short) strategy.close("Long") if (psar < low and time_cond and close > ema + offset) strategy.entry("Long", strategy.long, comment="Long", stop = psar) if (psar > high and time_cond and close < ema - offset) strategy.entry("Short", strategy.short, comment="Short", stop = psar) if (not time_cond) strategy.close_all()