
Die Strategie ist ein mehrschichtiges Bestätigungssystem für den Handel, das eine Kombination aus Meselinie-Kreuzung, RSI-Dynamik-Indikator und ATR-Volatilität-Indikator enthält. Die Strategie verwendet den 9-Zyklus- und 21-Zyklus-Indikator-Moving-Average (EMA) als Haupttrend-Basis, während die RSI-Indikator für die Dynamikbestätigung verwendet wird. Die Strategie verwendet den ATR-Indikator, um die Positionsgröße und die Stop-Loss-Position dynamisch anzupassen.
Die Kernlogik der Strategie basiert auf folgenden Ebenen:
Durch die Kombination der drei Dimensionen der Mittellinien-Kreuzung, der RSI-Dynamik und der ATR-Volatilität baut die Strategie ein robustes Handelssystem auf. Der Vorteil der Strategie liegt in ihrer vollständigen, mehrschichtigen Bestätigungsmechanik und dem dynamischen Risikomanagementsystem, aber in einem wackligen Markt kann es zu einem höheren Risiko kommen. Durch die Hinzufügung von Marktumfeldfilterungen und Optimierung von Parametern zur Anpassung verbessert die Strategie die Performance und verbessert die Gesamtheit des Raumes.
/*backtest
start: 2025-02-13 00:00:00
end: 2025-02-20 00:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Binance","currency":"ETH_USDT"}]
*/
//@version=5
strategy("BTC Scalping Strategy", overlay=true, margin_long=100, margin_short=100, pyramiding=1)
// Inputs
emaFastLength = input.int(9, "Fast EMA Length")
emaSlowLength = input.int(21, "Slow EMA Length")
rsiLength = input.int(14, "RSI Length")
rsiOverbought = input.int(70, "RSI Overbought")
rsiOversold = input.int(30, "RSI Oversold")
atrLength = input.int(14, "ATR Length")
riskPercent = input.float(1, "Risk Percentage", step=0.5)
// Calculate Indicators
emaFast = ta.ema(close, emaFastLength)
emaSlow = ta.ema(close, emaSlowLength)
rsi = ta.rsi(close, rsiLength)
atr = ta.atr(atrLength)
// Entry Conditions
longCondition = ta.crossover(emaFast, emaSlow) and rsi < rsiOverbought
shortCondition = ta.crossunder(emaFast, emaSlow) and rsi > rsiOversold
// Exit Conditions
takeProfitLevelLong = close + (atr * 3)
stopLossLevelLong = close - (atr * 1.5)
takeProfitLevelShort = close - (atr * 3)
stopLossLevelShort = close + (atr * 1.5)
// Position Sizing
equity = strategy.equity
riskAmount = equity * (riskPercent / 100)
positionSizeLong = riskAmount / (close - stopLossLevelLong)
positionSizeShort = riskAmount / (stopLossLevelShort - close)
// Strategy Execution
if (longCondition)
strategy.entry("Long", strategy.long, qty=positionSizeLong)
strategy.exit("Exit Long", "Long", limit=takeProfitLevelLong, stop=stopLossLevelLong)
if (shortCondition)
strategy.entry("Short", strategy.short, qty=positionSizeShort)
strategy.exit("Exit Short", "Short", limit=takeProfitLevelShort, stop=stopLossLevelShort)
// Plotting
plot(emaFast, color=color.new(color.blue, 0), linewidth=2)
plot(emaSlow, color=color.new(color.red, 0), linewidth=2)
hline(rsiOverbought, "RSI OB", color=color.new(color.red, 50))
hline(rsiOversold, "RSI OS", color=color.new(color.green, 50))
// Alerts
alertcondition(longCondition, "Long Signal", "Potential Long Entry")
alertcondition(shortCondition, "Short Signal", "Potential Short Entry")