This strategy is a trend-following trading system based on multiple technical indicators, combining EMA trends, RSI overbought/oversold conditions, and ATR volatility indicators to improve trading win rates and returns through multi-dimensional market analysis. The core logic uses short-term and long-term EMA crossovers to confirm trend direction, while utilizing RSI indicators to filter false breakouts and ATR to dynamically adjust holding periods for precise trend capture.
The strategy employs 20-day and 50-day EMAs as the primary basis for trend determination. An uptrend is confirmed when the short-term EMA crosses above the long-term EMA, and vice versa. Building on trend confirmation, the RSI indicator is introduced for overbought/oversold judgment, triggering long signals when RSI falls below 30 in oversold territory during uptrends, and short signals when RSI rises above 70 in overbought territory during downtrends. The ATR indicator measures market volatility, executing trades only when ATR exceeds the set threshold to avoid trading in low-volatility environments.
This strategy constructs a relatively complete trading system through comprehensive analysis of EMA trends, RSI overbought/oversold conditions, and ATR volatility. Its core advantage lies in cross-validation of multiple indicators, effectively reducing the impact of false signals. Through parameter optimization and risk control mechanism improvements, the strategy still has significant optimization potential. Traders are advised to adjust parameters according to specific market environments and strictly implement risk control measures when using in live trading.
/*backtest start: 2019-12-23 08:00:00 end: 2025-01-04 08:00:00 period: 1d basePeriod: 1d exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=5 strategy("High Win Rate BTC Strategy", overlay=true) // 参数设置 emaShortLength = input(20, title="Short EMA Length") emaLongLength = input(50, title="Long EMA Length") rsiLength = input(14, title="RSI Length") rsiOverbought = input(70, title="RSI Overbought Level") rsiOversold = input(30, title="RSI Oversold Level") atrLength = input(14, title="ATR Length") atrThreshold = input(1.0, title="ATR Threshold") holdBars = input(5, title="Hold Bars") // 计算指标 emaShort = ta.ema(close, emaShortLength) emaLong = ta.ema(close, emaLongLength) rsi = ta.rsi(close, rsiLength) atr = ta.atr(atrLength) // 趋势确认 uptrend = emaShort > emaLong downtrend = emaShort < emaLong // 入场条件 longCondition = uptrend and close > emaShort and rsi < rsiOverbought and atr > atrThreshold shortCondition = downtrend and close < emaShort and rsi > rsiOversold and atr > atrThreshold // 出场条件 var int holdCount = 0 if (strategy.position_size > 0 or strategy.position_size < 0) holdCount := holdCount + 1 else holdCount := 0 exitCondition = holdCount >= holdBars // 执行交易 if (longCondition) strategy.entry("Long", strategy.long) if (shortCondition) strategy.entry("Short", strategy.short) if (exitCondition) strategy.close_all() // 绘制指标 plot(emaShort, color=color.blue, title="Short EMA") plot(emaLong, color=color.red, title="Long EMA") hline(rsiOverbought, "RSI Overbought", color=color.red) hline(rsiOversold, "RSI Oversold", color=color.green) plot(rsi, color=color.purple, title="RSI")