The EMA tracking strategy is a trend strategy that uses the EMA indicator to track trends. It calculates the EMA value of prices and combines it with a percentage band to determine price trends and generate trading signals.
The core indicator of this strategy is EMA. EMA stands for Exponential Moving Average, which is a trend tracking indicator. EMA calculates the current average price based on historical prices and the set time period. EMA also has the effect of smoothing prices.
The strategy first calculates the 50-period EMA value of prices as the main judgment indicator. Then based on a certain percentage of the EMA value, the upper and lower rails are set. Here it is set to ±0.3% of the EMA value. When the price breaks through the upper rail of the EMA, a buy signal is generated. When the price falls below the lower rail of the EMA, a sell signal is generated. This can track the trend changes within the EMA cycle.
The EMA tracking strategy has clear overall logic, judging price trends through EMA indicators and generating trading signals with range bands. The advantages are simple rules that are easy to understand and can avoid some noise. But there are also problems like limited tuning space, lagging signals, poor drawdown control, etc. Next steps could be improving it via means like combining multiple indicators, stop loss optimization, etc. to make the strategy more practical and stable.
/*backtest start: 2023-01-17 00:00:00 end: 2024-01-23 00:00:00 period: 1d basePeriod: 1h exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=3 strategy(title="PingEMA50V.3 Piw", shorttitle="EMA50 Piw", overlay=true) // input src = input(title="Data Array",defval=close) ema_period = input(title="EMA period", defval=50) percent = input(title="Band %", type=float,defval=0.003) // ema ema50 = ema(src, ema_period) plot(ema50, color=green) // upper lower upper = ema50 + (ema50*percent) lower = ema50 - (ema50*percent) plot(upper, color=blue) plot(lower, color=blue) // signal buy = src > upper sell = src < lower // bar color bcolor = buy ? lime : red barcolor(color=bcolor) // trade if (buy) strategy.entry("long", strategy.long) if (sell) strategy.close("long")