
Die Strategie ist ein quantitatives Handelssystem, das mehrere technische Indikatoren kombiniert und die drei klassischen technischen Indikatoren durch den Moving Average (MA), den relativ starken Indikator (RSI) und den Moving Average Trend Scatter (MACD) zusammenführt, um ein vollständiges Handelssignalsystem zu erstellen. Die Strategie verwendet eine Kombination aus Trendverfolgung und Dynamikerkennung, um die richtige Handelsrichtung zu gewährleisten und gleichzeitig die Gelegenheit zu erfassen.
Die Strategie basiert auf der Konstruktion von Handelssignalen auf drei Ebenen:
Konkret, wenn die schnelle Durchschnittslinie ((50-Tage) über die langsame Durchschnittslinie ((200-Tage) gebildet Goldfork, während der RSI nicht überkaufen Ebene erreicht und MACD gebildet Goldfork, das System erzeugt ein Plus-Signal. Umgekehrt, wenn ein Dead-Fork auftritt und der RSI nicht überkaufen Ebene erreicht, MACD gebildet Dead-Fork, das System erzeugt ein Shutdown-Signal.
Die Strategie arbeitet mit mehreren technischen Indikatoren zusammen und baut ein relativ vollständiges Handelssystem auf. Die Strategie funktioniert gut in trendschaffenden Märkten, muss aber immer noch an die tatsächlichen Marktbedingungen angepasst werden. Es wird empfohlen, dass die Händler, wenn sie in der Praxis verwendet werden, zuerst eine ausreichende Rückmeldung überprüfen und die Parameter an ihre eigene Risikoverantwortung anpassen.
/*backtest
start: 2024-06-01 00:00:00
end: 2025-02-18 08:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Binance","currency":"ETH_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © EthioTrader
//@version=5
strategy("Optimal Multi-Indicator Strategy", overlay=true, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=10, commission_type=strategy.commission.percent, commission_value=0.1)
// ===== Input Parameters =====
// Moving Averages
fastMA = ta.sma(close, 50)
slowMA = ta.sma(close, 200)
plot(fastMA, "Fast MA", color=color.green)
plot(slowMA, "Slow MA", color=color.red)
// RSI
rsiLength = input(14, "RSI Length")
rsiOverbought = input(70, "RSI Overbought")
rsiOversold = input(30, "RSI Oversold")
rsi = ta.rsi(close, rsiLength)
// MACD
[macdLine, signalLine, _] = ta.macd(close, 12, 26, 9)
// Risk Management
stopLossPerc = input(2.0, "Stop Loss (%)") / 100
takeProfitPerc = input(4.0, "Take Profit (%)") / 100
trailingStopPerc = input(1.0, "Trailing Stop (%)") / 100
// ===== Strategy Logic =====
// Trend Condition: Golden Cross (Fast MA > Slow MA)
bullishTrend = ta.crossover(fastMA, slowMA)
bearishTrend = ta.crossunder(fastMA, slowMA)
// Momentum Condition: RSI and MACD
bullishMomentum = rsi < rsiOverbought and ta.crossover(macdLine, signalLine)
bearishMomentum = rsi > rsiOversold and ta.crossunder(macdLine, signalLine)
// Entry Signals
longCondition = bullishTrend and bullishMomentum
shortCondition = bearishTrend and bearishMomentum
// Exit Signals
trailingStop = strategy.position_avg_price * (1 - trailingStopPerc)
exitLong = ta.crossunder(close, trailingStop) or (close >= strategy.position_avg_price * (1 + takeProfitPerc))
exitShort = ta.crossover(close, trailingStop) or (close <= strategy.position_avg_price * (1 - takeProfitPerc))
// ===== Execute Orders =====
if (longCondition)
strategy.entry("Long", strategy.long)
strategy.exit("Exit Long", "Long", stop=strategy.position_avg_price * (1 - stopLossPerc), limit=strategy.position_avg_price * (1 + takeProfitPerc), trail_price=trailingStop, trail_offset=trailingStopPerc * close)
if (shortCondition)
strategy.entry("Short", strategy.short)
strategy.exit("Exit Short", "Short", stop=strategy.position_avg_price * (1 + stopLossPerc), limit=strategy.position_avg_price * (1 - takeProfitPerc), trail_price=trailingStop, trail_offset=trailingStopPerc * close)
// ===== Plotting =====
plotshape(series=longCondition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=shortCondition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")