
Die Strategie ist ein Trend-Tracking-Trading-System, basierend auf einem Multi-Index-Moving Average (EMA) und einer realen Bandbreite (ATR). Die Strategie erfasst die Markttrends durch die synchronisierte Kombination von drei EMAs mit 20-, 50- und 100-Zyklen und nutzt ATR für die dynamische Risikomanagement und die Ertragszielstellung. Diese Methode gewährleistet sowohl die Systematik des Handels als auch die dynamische Kontrolle des Risikos.
Die Kernlogik der Strategie basiert auf der Wechselbeziehung zwischen dem Preis und mehreren EMAs.
Durch die Kombination von Multiple Equilibrium-System und ATR Dynamic Wind Control erstellt die Strategie ein Trading-System mit Trend-Tracking und Bandbreiten-Betrieb. Die Strategie hat den Vorteil, dass sie systematisch und risikokontrollierbar ist. In der praktischen Anwendung muss jedoch auf die Anpassung an die Marktumgebung geachtet und entsprechend den tatsächlichen Umständen gezielt optimiert werden. Mit vernünftigen Parametersätzen und strenger Risikokontrolle wird die Strategie in den meisten Marktumgebungen zu stabilen Handelsergebnissen führen.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-18 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=6
strategy("EMA Swing Strategy with ATR", overlay=true)
// Inputs
emaShort = input.int(20, "Short EMA")
emaMid = input.int(50, "Mid EMA")
emaLong = input.int(100, "Long EMA")
rrRatio = input.float(1.5, "Risk-Reward Ratio")
contracts = input.int(5, "Number of Contracts")
// Calculations
ema20 = ta.ema(close, emaShort)
ema50 = ta.ema(close, emaMid)
ema100 = ta.ema(close, emaLong)
atr = ta.atr(14)
// Conditions
longCondition = ta.crossover(close, ema20) and close > ema50
shortCondition = ta.crossunder(close, ema20) and close < ema50
// Variables for trades
var float entryPrice = na
var float stopLoss = na
var float takeProfit = na
// Long Trades
if (longCondition)
entryPrice := close
stopLoss := close - atr
takeProfit := close + atr * rrRatio
strategy.entry("Long", strategy.long, contracts)
strategy.exit("Exit Long", from_entry="Long", stop=stopLoss, limit=takeProfit)
// Short Trades
if (shortCondition)
entryPrice := close
stopLoss := close + atr
takeProfit := close - atr * rrRatio
strategy.entry("Short", strategy.short, contracts)
strategy.exit("Exit Short", from_entry="Short", stop=stopLoss, limit=takeProfit)
// Plot EMAs
plot(ema20, color=color.green, title="EMA 20")
plot(ema50, color=color.red, title="EMA 50")
plot(ema100, color=color.white, title="EMA 100")
// Visualization for Entries
plotshape(series=longCondition, style=shape.labelup, color=color.green, location=location.belowbar, title="Long Entry")
plotshape(series=shortCondition, style=shape.labeldown, color=color.red, location=location.abovebar, title="Short Entry")