
Die Strategie ist ein automatisiertes Handelssystem, das auf mehrfachen Index-Moving Averages (EMA) basiert und Handelssignale durch die Schichtung von 5-, 20- und 50-Zyklen-EMA-Urteilen erzeugt. Die Systemkonstruktion ist einzigartig in der Verwendung von mehrfachen EMA-Urteilen, die auf Höhen, Tiefen und Schließungspreisen basieren, und kombiniert mit einem dynamischen Stop-Loss- und Tracking-Stop-Mechanismus, um Risiken effektiv zu kontrollieren und gleichzeitig Gewinne zu sichern.
Die Strategie basiert auf EMA-Kreuz- und Positionsbeziehungen in mehreren Zeiträumen.
Es handelt sich um ein sorgfältig konzipiertes Multiple-Even-Line-Handelssystem, das Risiken durch stratifizierte Filterung und dynamische Stop-Losses wirksam kontrolliert. Es ist empfehlenswert, die Parameter entsprechend den Merkmalen der verschiedenen Märkte anzupassen und die Zuverlässigkeit durch die Einbeziehung von Hilfsindikatoren wie Transaktionsvolumen zu erhöhen.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-03 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Automated EMA Strategy with Hierarchical Conditions", overlay=true)
// Inputs for EMA lengths
length_5 = 5
length_20 = 20
length_50 = 50
// Calculating EMAs
ema_5 = ta.ema(close, length_5)
ema_20_high = ta.ema(high, length_20)
ema_20_low = ta.ema(low, length_20)
ema_20_close = ta.ema(close, length_20)
ema_50 = ta.ema(close, length_50)
// Buy condition: 50 EMA < 20 EMA (Close) < 20 EMA (High) < 20 EMA (Low) < 5 EMA
// and LTP above all EMAs
buy_condition = ema_50 < ema_20_low and ema_20_low < ema_20_close and ema_20_close < ema_20_high and ema_20_high < ema_5 and close > ema_5 and close > ema_20_close and close > ema_20_high and close > ema_20_low and close > ema_50
// Stop-loss and target levels
stop_loss = ema_20_low
// Target condition: Close below 5 EMA
target_condition = close < ema_5
// Check if there's an open position
is_in_position = strategy.position_size > 0
// Execute Buy Signal only if no position is open
if (buy_condition and not is_in_position)
strategy.entry("Buy", strategy.long)
// Exit conditions: Stop-loss or target (close below 5 EMA)
if (is_in_position and (target_condition or close < stop_loss))
strategy.close("Buy")
// Plotting the EMAs
plot(ema_5, color=color.blue, title="5 EMA")
plot(ema_20_high, color=color.green, title="20 EMA (High)")
plot(ema_20_low, color=color.red, title="20 EMA (Low)")
plot(ema_20_close, color=color.purple, title="20 EMA (Close)")
plot(ema_50, color=color.orange, title="50 EMA")