
This is a quantitative trading strategy based on dual EMA crossover and trend following. The strategy primarily utilizes 47-period and 95-period Exponential Moving Averages (EMA) to capture market trends, executing trades based on EMA crossover signals. Operating on a 15-minute timeframe, it combines technical analysis and momentum trading principles to achieve consistent trading returns.
The core mechanism relies on identifying trend changes through crossovers between short-term EMA (47-period) and long-term EMA (95-period). Buy signals are generated when the short-term EMA crosses above the long-term EMA, while positions are closed when the short-term EMA crosses below. This design is based on price momentum and trend continuation principles, using EMA crossovers to confirm trend transition points.
This is a well-structured and logically rigorous trend-following strategy. It captures market trends through dual EMA crossovers, offering good operability and scalability. While certain limitations exist, continuous optimization and improvement can develop it into a stable and reliable trading system. The key is to flexibly adjust parameters based on different market characteristics and establish comprehensive risk control mechanisms.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-11-27 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("EMA Crossover Strategy", overlay=true)
// Define the EMA periods
shortEmaPeriod = 47
longEmaPeriod = 95
// Calculate EMAs
ema11 = ta.ema(close, shortEmaPeriod)
ema21 = ta.ema(close, longEmaPeriod)
// Plot EMAs on the chart
plot(ema11, title="11 EMA", color=color.blue, linewidth=2)
plot(ema21, title="21 EMA", color=color.red, linewidth=2)
// Generate trading signals
longSignal = ta.crossover(ema11, ema21)
shortSignal = ta.crossunder(ema11, ema21)
// Execute trades based on signals
if (longSignal)
strategy.entry("Buy", strategy.long)
if (shortSignal)
strategy.close("Buy")
// Optional: Plot buy and sell signals on the chart
plotshape(series=longSignal, location=location.belowbar, color=color.green, style=shape.labelup, text="Buy")
plotshape(series=shortSignal, location=location.abovebar, color=color.red, style=shape.labeldown, text="Sell")
// Plot buy/sell signals on the main chart
plotshape(series=longSignal, location=location.belowbar, color=color.green, style=shape.labelup, text="Buy")
plotshape(series=shortSignal, location=location.abovebar, color=color.red, style=shape.labeldown, text="Sell")