
Die Strategie ist ein Trend-Tracking-Trading-System, das auf der Kreuzung von schnellen und langsamen Index-Moving Averages (EMA) basiert. Es erzeugt zuverlässigere Kauf- und Verkaufssignale, indem es die Position des Preises in Bezug auf die doppelte Mittellinie bestätigt. Die Strategie bietet eine eingebaute Rücklauf-Zeitrahmen-Einstellung, um die Strategie-Performance in bestimmten Zeitrahmen zu bewerten.
Die Strategie verwendet 10- und 20-Zyklen-EMA als Kernindikator. Mehr Signale werden ausgelöst, wenn ein schneller EMA aufwärts durch den langsamen EMA geht und der Schlusskurs über den beiden Mittelwerten liegt. Ein Abbruchsignal wird ausgelöst, wenn ein schneller EMA abwärts durch den langsamen EMA geht und der Schlusskurs unter den beiden Mittelwerten liegt.
Dies ist eine klar strukturierte, logisch strenge Trend-Tracking-Strategie. Durch die doppelte lineare Kreuzung in Verbindung mit der Preisbestätigungsmechanik wird die Aktualität und die Zuverlässigkeit des Signals effektiv ausgeglichen. Die Strategie ist gut skalierbar und kann durch Optimierung weiter verbessert werden.
/*backtest
start: 2024-02-21 00:00:00
end: 2024-10-01 00:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Binance","currency":"BNB_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © BFXGold
//@version=5
strategy("BFX Buy and Sell", overlay=true)
// Inputs
ema_fast_length = input.int(10, title="Fast EMA Length")
ema_slow_length = input.int(20, title="Slow EMA Length")
// Calculate EMAs
ema_fast = ta.ema(close, ema_fast_length)
ema_slow = ta.ema(close, ema_slow_length)
// Confirmation candles
confirmation_above = close > ema_fast and close > ema_slow
confirmation_below = close < ema_fast and close < ema_slow
// Crossovers with confirmation
long_condition = ta.crossover(ema_fast, ema_slow) and confirmation_above
short_condition = ta.crossunder(ema_fast, ema_slow) and confirmation_below
// Plot signals
if (long_condition )
label.new(bar_index, low, text="BUY", style=label.style_label_up, color=color.new(color.green, 0), textcolor=color.white)
if (short_condition)
label.new(bar_index, high, text="SELL", style=label.style_label_down, color=color.new(color.red, 0), textcolor=color.white)
// Strategy execution for backtesting
if (long_condition)
strategy.entry("Long", strategy.long)
if (short_condition)
strategy.entry("Short", strategy.short)
// Plot EMAs
plot(ema_fast, title="Fast EMA (10)", color=color.blue, linewidth=1)
plot(ema_slow, title="Slow EMA (20)", color=color.orange, linewidth=1)