
Die Strategie ist ein integriertes Handelssystem, das Trendverfolgung und Risikokontrolle kombiniert. Sie verwendet den 200-Zyklus-Index-Moving Average (EMA) als Trendfilter, den relativ starken Index (RSI) als Einstiegssignal und integriert Stopps, Stopps und Maximal-Retracing-Kontrollmechanismen. Das Hauptmerkmal der Strategie ist, das Risiko durch dynamische Retracing-Tracking streng zu kontrollieren, während die Vorteile des Trendverfolgens beibehalten werden.
Die Kernlogik der Strategie umfasst folgende Schlüsselkomponenten:
Die Strategie baut ein vollständiges Handelssystem auf, indem sie Trendverfolgung und strenge Risikokontrollen kombiniert. Ihr zentraler Vorteil liegt in der Vollständigkeit des Risikomanagements und der Klarheit der Strategielogik. Durch ein mehrschichtiges Risikokontrollmechanismus kann die Strategie den Rückzug effektiv kontrollieren, während sie die Erträge anstrebt.
/*backtest
start: 2024-11-19 00:00:00
end: 2024-12-19 00:00:00
period: 2h
basePeriod: 2h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy(title="Disruptor Trend-Following (Drawdown < 30%)", shorttitle="DisruptorStrategyDD", overlay=true)
//-----------------------------------------------------
// User Inputs
//-----------------------------------------------------
emaLen = input.int(200, "Long EMA Length", minval=1)
rsiLen = input.int(14, "RSI Length", minval=1)
rsiThreshold = input.float(50, "RSI Buy Threshold", minval=1, maxval=100)
stopLossPerc = input.float(20, "Stop-Loss %", minval=0.1, step=0.1)
takeProfitPerc = input.float(40, "Take-Profit %", minval=0.1, step=0.1)
ddLimit = input.float(30, "Max Drawdown %", minval=0.1, step=0.1)
//-----------------------------------------------------
// Indicators
//-----------------------------------------------------
emaValue = ta.ema(close, emaLen)
rsiValue = ta.rsi(close, rsiLen)
//-----------------------------------------------------
// Conditions
//-----------------------------------------------------
longCondition = close > emaValue and rsiValue > rsiThreshold
exitCondition = close < emaValue or rsiValue < rsiThreshold
//-----------------------------------------------------
// Position Tracking
//-----------------------------------------------------
var bool inTrade = false
if longCondition and not inTrade
strategy.entry("Long", strategy.long)
if inTrade and exitCondition
strategy.close("Long")
inTrade := strategy.position_size > 0
//-----------------------------------------------------
// Stop-Loss & Take-Profit
//-----------------------------------------------------
if inTrade
stopPrice = strategy.position_avg_price * (1 - stopLossPerc / 100)
takeProfitPrice = strategy.position_avg_price * (1 + takeProfitPerc / 100)
strategy.exit("Exit", from_entry="Long", stop=stopPrice, limit=takeProfitPrice)
//-----------------------------------------------------
// Dynamic Drawdown Handling
//-----------------------------------------------------
var float peakEquity = strategy.equity
peakEquity := math.max(peakEquity, strategy.equity)
currentDrawdownPerc = (peakEquity - strategy.equity) / peakEquity * 100
if currentDrawdownPerc > ddLimit
strategy.close_all("Max Drawdown Exceeded")
//-----------------------------------------------------
// Plotting
//-----------------------------------------------------
plot(emaValue, title="EMA 200", color=color.yellow, linewidth=2)
plotchar(rsiValue, title="RSI", char='•', location=location.bottom, color=color.new(color.teal, 60))