
Die Strategie ist ein auf der technischen Analyse basierendes Trend-Tracking-System, das hauptsächlich die Kreuzung von 50-Zyklus-Index-Moving Averages (EMA) und 200-Zyklus-Simple Moving Averages (MA) verwendet, um Markttrends zu erfassen. Die Strategie integriert einen dynamischen Stop-Loss-Mechanismus, um Risiken zu kontrollieren und Gewinne zu sperren.
Die Kernlogik der Strategie basiert auf der Überschneidung zweier Gleichlinien: Wenn ein 50-Zyklus-EMA nach oben über den 200-Zyklus-MA geht, erzeugt das System ein Mehr-Signal; wenn ein 50-Zyklus-EMA nach unten über den 200-Zyklus-MA geht, erzeugt das System ein Null-Signal. Nach jeder Position wird automatisch ein Stop-Loss-Eintritt (3 Punkte über dem Einstiegspreis) und ein Stop-Loss-Eintritt (7,5 Punkte über dem Einstiegspreis) eingerichtet.
Die Strategie kombiniert klassische Doppel-Linien-Cross-Systeme mit dynamischen Stop-Loss-Mechanismen, um ein vollständiges Trend-Tracking-Handelssystem zu erstellen. Die Strategie hat den Vorteil, dass sie sehr systematisch und gut risikokontrolliert ist, aber in der praktischen Anwendung muss sie immer noch an die spezifische Marktumgebung und die Größe des Kapitals angepasst werden.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-11-24 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("200 MA & 50 EMA Crossover Strategy with **Estimated** SL & TP", overlay=true)
// Parameters for the 200 MA and 50 EMA
ma200 = ta.sma(close, 200) // 200-period simple moving average
ema50 = ta.ema(close, 50) // 50-period exponential moving average
// Plot the MA and EMA on the chart
plot(ma200, color=color.blue, linewidth=2, title="200 MA")
plot(ema50, color=color.red, linewidth=2, title="50 EMA")
// Define **estimated** stop loss and take profit values
// SL = 3 points, TP = 7.5 points from the entry price
sl_points = 3
tp_points = 7.5
// Buy signal: when the 50 EMA crosses above the 200 MA (bullish crossover)
if (ta.crossover(ema50, ma200))
strategy.entry("Buy", strategy.long)
// Set **estimated** stop loss and take profit strategy.exit("Take Profit/Stop Loss", "Buy", stop=strategy.position_avg_price - sl_points, limit=strategy.position_avg_price + tp_points)
// Sell signal: when the 50 EMA crosses below the 200 MA (bearish crossover)
if (ta.crossunder(ema50, ma200))
strategy.entry("Sell", strategy.short)
// Set **estimated** stop loss and take profit strategy.exit("Take Profit/Stop Loss", "Sell", stop=strategy.position_avg_price + sl_points, limit=strategy.position_avg_price - tp_points)
// Optional: Close the position when an opposite signal appears
if (strategy.position_size > 0 and ta.crossunder(ema50, ma200))
strategy.close("Buy")
if (strategy.position_size < 0 and ta.crossover(ema50, ma200))
strategy.close("Sell")