
Die Strategie basiert auf dem Ichimoku Cloud Chart Indicator und entwickelt ein quantitatives Handelssystem, das hauptsächlich für gut trendige Vermögenswerte verwendet wird. Die Strategie kombiniert Funktionen wie Stop Loss, Stop Loss und Tracking Stop Loss, um stabile Gewinne zu erzielen.
Der Ichimoku-Cloud-Diagramm besteht aus der Umrechnung, der Benchmark, der Frontlinie 1, der Frontlinie 2 und der Cloud-Diagramm. Die Handelssignale für diese Strategie stammen aus der Beziehung zwischen dem Preis und der Cloud-Diagramm. Insbesondere wird ein Kaufsignal erzeugt, wenn der Preis die Frontlinie 1 überquert.
Die Strategie enthält auch Stop-Loss- und Stop-Off-Bedingungen, die auf den ATR-Indikatoren basieren. Die ATR-Indikatoren können die Schwankungen des Marktes effektiv erfassen. Die Stop-Loss-Bedingung ist 2 mal so hoch wie die ATR und die Stop-Off-Bedingung ist 4 mal so hoch wie die ATR.
Schließlich verwendet die Strategie einen Stop-Tracking-Mechanismus. Konkret wird bei Überbestellungen das 2-fache des ATR als Rücktritt verwendet, um die Stop-Line in Echtzeit anzupassen, um Gewinne zu sperren.
Die Risiken können mit folgenden Lösungen begegnet werden:
Die Strategie ist im Allgemeinen eine stabile Trend-Tracking-Strategie. Die Trendrichtung wird anhand der Ichimoku-Wolkendiagramm-Indikatoren beurteilt; die Stop-Loss-Marke wird mit den ATR-Indikatoren festgelegt; die Gewinne werden durch die Tracking-Stop-Loss-Verfolgung gesperrt. Die Vorteile sind, dass die Logik einfach und leicht verständlich ist. Ein einzelner Verlust kann kontrolliert werden.
/*backtest
start: 2023-01-05 00:00:00
end: 2024-01-11 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Ichimoku Cloud Strategy with SL, TP, and Trailing Stop", overlay=true)
conversionPeriods = input(9, "Conversion Line Length")
basePeriods = input(26, "Base Line Length")
laggingSpan2Periods = input(52, "Leading Span B Length")
displacement = input(26, "Lagging Span")
atrLength = input(14, title="ATR Length")
donchian(len) => math.avg(ta.lowest(len), ta.highest(len))
conversionLine = donchian(conversionPeriods)
baseLine = donchian(basePeriods)
leadLine1 = math.avg(conversionLine, baseLine)
leadLine2 = donchian(laggingSpan2Periods)
// Plot the Ichimoku Cloud components
plot(conversionLine, color=color.blue, title="Conversion Line")
plot(baseLine, color=color.red, title="Base Line")
plot(leadLine1, color=color.green, title="Leading Span A")
plot(leadLine2, color=color.orange, title="Leading Span B")
plot(leadLine1 > leadLine2 ? leadLine1 : leadLine2, color=color.green, title="Kumo Cloud Upper Line")
plot(leadLine1 < leadLine2 ? leadLine1 : leadLine2, color=color.red, title="Kumo Cloud Lower Line")
// ATR for stop loss and take profit
atrValue = ta.atr(atrLength)
stopLoss = atrValue * 2
takeProfit = atrValue * 4
// Strategy entry and exit conditions
longCondition = ta.crossover(close, leadLine1) and close > leadLine2
shortCondition = ta.crossunder(close, leadLine1) and close < leadLine2
// Plot buy and sell signals
plotshape(series=longCondition ? leadLine1 : na, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)
plotshape(series=shortCondition ? leadLine1 : na, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small)
// Execute strategy orders with stop loss and take profit
strategy.entry("Buy", strategy.long, when=longCondition)
strategy.close("Buy", when=shortCondition) // Close buy position when sell condition is met
strategy.entry("Sell", strategy.short, when=shortCondition)
strategy.close("Sell", when=longCondition) // Close sell position when buy condition is met
// Trailing stop
strategy.cancel("Trailing Stop")
var float trailingStopPrice = na
if (longCondition)
trailingStopPrice := math.max(trailingStopPrice, close - atrValue * 2)
strategy.exit("Trailing Stop", from_entry="Buy", trail_offset=atrValue * 2, trail_price=trailingStopPrice)
else if (shortCondition)
trailingStopPrice := math.min(trailingStopPrice, close + atrValue * 2)
strategy.exit("Trailing Stop", from_entry="Sell", trail_offset=atrValue * 2, trail_price=trailingStopPrice)