
Es ist ein Handelsstrategie-System, das auf vier Perioden einfacher gleitender Durchschnitte basiert und eine dynamische Stop-Loss-Management-Mechanik integriert. Die Strategie erfasst die Wendepunkte der Markttrends durch die Überwachung der Preise und der Kreuzung der kurzfristigen Durchschnittswerte und setzt Stop-Losses in Prozentform zur Risikomanagement.
Die Strategie basiert auf der folgenden Kernlogik: Zuerst wird der 4-Zyklus-SMA als Hauptindikator berechnet. Wenn der Preis die SMA nach oben durchbricht, wird das System als Überblicksignal identifiziert und eine Position aufgenommen. Wenn der Preis die SMA nach unten durchbricht, wird das System als Überblicksignal identifiziert und eine Position aufgenommen.
Es handelt sich um eine strukturierte, logisch eindeutige und quantifizierte Handelsstrategie. Sie erfasst die Marktdynamik durch kurzfristige Mittelwerte und ist mit einem strengen Risikokontrollmechanismus ausgestattet. Sie ist für Händler geeignet, die nach stabilen Erträgen streben.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-11-28 00:00:00
period: 2d
basePeriod: 2d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("4SMA Strategy with Targets and Stop Loss", overlay=true)
// Input parameters for SMA
smaLength = input.int(4, title="SMA Length", minval=1)
// Input parameters for stop loss and take profit
takeProfitPercent = input.float(2.0, title="Take Profit (%)", step=0.1) // Default: 2%
stopLossPercent = input.float(1.0, title="Stop Loss (%)", step=0.1) // Default: 1%
// Calculate 4-period SMA
sma = ta.sma(close, smaLength)
// Plot SMA
plot(sma, color=color.blue, title="4SMA Line")
// Entry Conditions
longCondition = ta.crossover(close, sma) // Price crosses above SMA (bullish signal)
shortCondition = ta.crossunder(close, sma) // Price crosses below SMA (bearish signal)
// Strategy Logic
if (longCondition)
strategy.entry("Long", strategy.long) // Enter long position
if (shortCondition)
strategy.entry("Short", strategy.short) // Enter short position
// Calculate Take Profit and Stop Loss
longTakeProfit = strategy.position_avg_price * (1 + takeProfitPercent / 100) // TP for long
longStopLoss = strategy.position_avg_price * (1 - stopLossPercent / 100) // SL for long
shortTakeProfit = strategy.position_avg_price * (1 - takeProfitPercent / 100) // TP for short
shortStopLoss = strategy.position_avg_price * (1 + stopLossPercent / 100) // SL for short
// Exit for Long
if (strategy.position_size > 0) // If in a long position
strategy.exit("Long TP/SL", from_entry="Long", limit=longTakeProfit, stop=longStopLoss)
// Exit for Short
if (strategy.position_size < 0) // If in a short position
strategy.exit("Short TP/SL", from_entry="Short", limit=shortTakeProfit, stop=shortStopLoss)