This strategy is a comprehensive trading system that combines multiple-period moving averages, RSI overbought/oversold signals, and price pattern recognition. The strategy primarily generates trading signals by identifying market trend turning points through the intersection of fast and slow moving averages, RSI indicator’s overbought/oversold zones, and bullish/bearish engulfing patterns. The strategy employs percentage-based position management, using 10% of account equity by default for each trade, which helps achieve better risk control.
The core logic of the strategy is based on the following key elements:
This is a well-designed, logically sound comprehensive technical analysis trading strategy. By combining multiple technical indicators and price patterns, the strategy achieves reliable signal generation while maintaining good risk control. Although it has some inherent limitations, the strategy’s overall performance can be further improved through the suggested optimization directions. Users need to pay attention to parameter optimization and market environment adaptation in practical applications to achieve optimal trading results.
/*backtest start: 2019-12-23 08:00:00 end: 2024-12-04 00:00:00 period: 1d basePeriod: 1d exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=5 strategy("Comprehensive Trading Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10) // Input parameters for moving averages fastLength = input.int(9, title="Fast MA Length") slowLength = input.int(21, title="Slow MA Length") rsiLength = input.int(14, title="RSI Length") rsiOverbought = input.int(70, title="RSI Overbought Level") rsiOversold = input.int(30, title="RSI Oversold Level") // Calculate moving averages fastMA = ta.sma(close, fastLength) slowMA = ta.sma(close, slowLength) // Calculate RSI rsi = ta.rsi(close, rsiLength) // Detect price action patterns (e.g., engulfing patterns) isBullishEngulfing = close > open and close[1] < open[1] and open < close[1] and close > open[1] isBearishEngulfing = close < open and close[1] > open[1] and open > close[1] and close < open[1] // Define conditions for buying and selling buyCondition = ta.crossover(fastMA, slowMA) and rsi < rsiOversold or isBullishEngulfing sellCondition = ta.crossunder(fastMA, slowMA) and rsi > rsiOverbought or isBearishEngulfing // Execute buy and sell orders if (buyCondition) strategy.entry("Buy", strategy.long) if (sellCondition) strategy.entry("Sell", strategy.short) // Plotting plot(fastMA, color=color.blue, linewidth=2, title="Fast MA") plot(slowMA, color=color.orange, linewidth=2, title="Slow MA") hline(rsiOverbought, "RSI Overbought", color=color.red) hline(rsiOversold, "RSI Oversold", color=color.green) plot(rsi, color=color.purple, linewidth=1, title="RSI") // Alert conditions alertcondition(buyCondition, title="Buy Signal", message="Price meets buy criteria") alertcondition(sellCondition, title="Sell Signal", message="Price meets sell criteria") // Plot signals on chart plotshape(series=buyCondition ? low : na, location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small, title="Buy Signal") plotshape(series=sellCondition ? high : na, location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small, title="Sell Signal")