
Die Strategie ist ein Mean-Return-Trading-System, das Bollinger Bands und einen relativ starken RSI kombiniert. Die Strategie identifiziert Extreme, bei denen der Preis vom Mittelwert abweicht, und kombiniert die RSI mit einem Überkauf-Überverkauf-Signal, um den Zeitpunkt des Handels zu bestimmen.
Die Kernlogik der Strategie basiert auf der Mittelwert-Rücklauf-Eigenschaft der Finanzmärkte. Bei der konkreten Implementierung wird der 20-Tage-Simple Moving Average (SMA) als Mittelwert-Referenz verwendet, wobei die Standarddifferenzmenge 2.0 für die Berechnung der Brin-Bandbreite verwendet wird. Der 14-Tage-RSI wird als Hilfsindikator eingeführt, wobei 70 und 30 als Überkauf-Überverkauf-Schwellenwerte festgelegt werden. Die Strategie löst nur dann ein Handelssignal aus, wenn der Preis die Brin-Band durchbricht und der RSI die Extreme erreicht.
Die Strategie baut durch die Synergie von Brin-Band und RSI ein robustes Mean-Return-Trading-System auf. Die Strategie ist vernünftig konzipiert, hat eine gute Skalierbarkeit und Anpassungsfähigkeit. Durch kontinuierliche Optimierung und Verbesserung kann die Stabilität und Profitabilität der Strategie weiter verbessert werden.
/*backtest
start: 2024-11-19 00:00:00
end: 2024-12-18 08:00:00
period: 2h
basePeriod: 2h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Mean Reversion Strategy", overlay=true)
// User Inputs
length = input.int(20, title="SMA Length") // Moving Average length
stdDev = input.float(2.0, title="Standard Deviation Multiplier") // Bollinger Band deviation
rsiLength = input.int(14, title="RSI Length") // RSI calculation length
rsiOverbought = input.int(70, title="RSI Overbought Level") // RSI overbought threshold
rsiOversold = input.int(30, title="RSI Oversold Level") // RSI oversold threshold
// Bollinger Bands
sma = ta.sma(close, length) // Calculate the SMA
stdDevValue = ta.stdev(close, length) // Calculate Standard Deviation
upperBand = sma + stdDev * stdDevValue // Upper Bollinger Band
lowerBand = sma - stdDev * stdDevValue // Lower Bollinger Band
// RSI
rsi = ta.rsi(close, rsiLength) // Calculate RSI
// Plot Bollinger Bands
plot(sma, color=color.orange, title="SMA") // Plot SMA
plot(upperBand, color=color.red, title="Upper Bollinger Band") // Plot Upper Band
plot(lowerBand, color=color.green, title="Lower Bollinger Band") // Plot Lower Band
// Plot RSI Levels (Optional)
hline(rsiOverbought, "Overbought Level", color=color.red, linestyle=hline.style_dotted)
hline(rsiOversold, "Oversold Level", color=color.green, linestyle=hline.style_dotted)
// Buy and Sell Conditions
buyCondition = (close < lowerBand) and (rsi < rsiOversold) // Price below Lower Band and RSI Oversold
sellCondition = (close > upperBand) and (rsi > rsiOverbought) // Price above Upper Band and RSI Overbought
// Execute Strategy
if (buyCondition)
strategy.entry("Buy", strategy.long)
if (sellCondition)
strategy.entry("Sell", strategy.short)
// Optional: Plot Buy/Sell Signals
plotshape(series=buyCondition, location=location.belowbar, color=color.green, style=shape.labelup, title="Buy Signal")
plotshape(series=sellCondition, location=location.abovebar, color=color.red, style=shape.labeldown, title="Sell Signal")