
Die Strategie ist ein Trend-Tracking-Trading-System, das einen einfachen Moving Average (SMA) mit einem relativ starken Indikator (RSI) kombiniert. Es identifiziert die Richtung des Trends durch die Kreuzung von kurz- und langfristigen Moving Averages und nutzt die RSI zur Bewegungskonfirmation, um nach hochprobablen Handelsmöglichkeiten in den Märkten zu suchen. Die Strategie enthält auch ein komplettes Risikomanagement-Modul, um das Risiko für jeden Handel effektiv zu kontrollieren.
Die Kernlogik der Strategie basiert auf der kombinierten Verwendung zweier technischer Indikatoren:
Es ist eine strukturierte, logisch klare Trend-Tracking-Strategie. Durch die Kombination von SMA und RSI kann sowohl ein Trend erfasst werden, als auch ein übermäßiger Handel in den Kauf- und Verkaufszonen vermieden werden. Die eingebaute Risikomanagement-Mechanismen gewährleisten die Stabilität der Strategie.
/*backtest
start: 2025-02-16 00:00:00
end: 2025-02-23 00:00:00
period: 6m
basePeriod: 6m
exchanges: [{"eid":"Binance","currency":"SOL_USDT"}]
*/
//@version=6
strategy("WEN - SMA with RSI Strategy", overlay=true)
// Define input parameters
// SMA Inputs
shortLength = input(8, title="Short MA Length")
longLength = input(21, title="Long MA Length")
// RSI Inputs
rsiLength = input(14, title="RSI Length")
rsiOverbought = input(70, title="RSI Overbought")
rsiOversold = input(30, title="RSI Oversold")
// Calculate indicators
// Moving Averages
shortMA = ta.sma(close, shortLength)
longMA = ta.sma(close, longLength)
// RSI
rsi = ta.rsi(close, rsiLength)
// Plot indicators
plot(shortMA, title="Short MA", color=color.blue)
plot(longMA, title="Long MA", color=color.red)
// RSI is typically plotted in a separate panel in trading platforms
// Entry conditions with RSI confirmation
smaLongCondition = ta.crossover(shortMA, longMA)
smaShortCondition = ta.crossunder(shortMA, longMA)
rsiLongCondition = rsi < rsiOverbought // Not overbought for long entry
rsiShortCondition = rsi > rsiOversold // Not oversold for short entry
// Combined entry conditions
longCondition = smaLongCondition and rsiLongCondition
shortCondition = smaShortCondition and rsiShortCondition
// Execute trades
if (longCondition)
strategy.entry("Long", strategy.long)
if (shortCondition)
strategy.close("Long")
strategy.entry("Short", strategy.short)
// Set stop loss and take profit
stopLoss = input(1, title="Stop Loss (%)") / 100
takeProfit = input(2, title="Take Profit (%)") / 100
longStopLossPrice = strategy.position_avg_price * (1 - stopLoss)
longTakeProfitPrice = strategy.position_avg_price * (1 + takeProfit)
shortStopLossPrice = strategy.position_avg_price * (1 + stopLoss)
shortTakeProfitPrice = strategy.position_avg_price * (1 - takeProfit)
strategy.exit("Take Profit / Stop Loss", from_entry="Long", stop=longStopLossPrice, limit=longTakeProfitPrice)
strategy.exit("Take Profit / Stop Loss", from_entry="Short", stop=shortStopLossPrice, limit=shortTakeProfitPrice)