
데-크롤 스톱 다이내믹 ATR 트렌드 추적 전략은 데-크롤 스톱 지표와 간단한 이동 평균 (SMA) 을 기반으로 한 정량화 거래 전략이다. 이 전략은 시장의 상승 추세를 포착하면서 동적 스톱을 사용하여 위험을 관리한다. 데-크롤 스톱 지표는 평균 실제 파도 (ATR) 에 따라 동적으로 스톱 레벨을 조정하여 다양한 시장 변동 상황에 맞게 조정한다.
이 전략의 핵심은 Chande-Kroll Stop loss indicator로, ATR을 사용하여 동적 중지 수준을 계산한다. ATR은 시장의 변동성을 측정하며, 중지 수준은 ATR과 곱하기 동적 변화에 따라 조정된다. 더하기 조건: 종전 가격이 Chande-Kroll 하향 궤도를 돌파하고 21주기 SMA보다 높을 때 더하기 시작하십시오. 평점 조건: 종점 가격이 Chande-Kroll 상반도를 넘어갈 때 평점.
데-크롤 정지 동적 ATR 트렌드 추적 전략은 동적 정지 및 트렌드 추적 원칙에 기반한 양적 거래 전략이다. 데-크롤 정지 지표와 SMA 트렌드 필터를 결합하여 전략은 상승 추세를 포착하면서 위험을 효과적으로 관리할 수 있다. 전략의 매개 변수의 유연성과 포지션 규모의 동적 조정으로 전략의 적응성을 더욱 강화한다. 전략에는 약간의 위험이 있음에도 불구하고 합리적인 위험 관리 조치와 지속적인 최적화 개선으로 전략은 장기적으로 안정적인 수익을 얻을 수 있다.
/*backtest
start: 2023-06-08 00:00:00
end: 2024-06-13 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Chande Kroll Stop Strategy", overlay=true, initial_capital = 1000, commission_type = strategy.commission.percent, commission_value = 0.01, slippage = 3)
// Chande Kroll Stop parameters
calcMode = input.string(title="Calculation Mode", defval="Exponential", options=["Linear", "Exponential"])
riskMultiplier = input(5, "Risk Multiplier")
atrPeriod = input(10, "ATR Period")
atrMultiplier = input(3, "ATR Multiplier")
stopLength = input(21, "Stop Length")
smaLength = input(21, "SMA Length")
// Calculate ATR
atr = ta.atr(atrPeriod)
// Calculate Chande Kroll Stop
highStop = ta.highest(high, stopLength) - atrMultiplier * atr
lowStop = ta.lowest(low, stopLength) + atrMultiplier * atr
sma21 = ta.sma(close, smaLength)
// Entry and Exit conditions
longCondition = ta.crossover(close, lowStop) and close > sma21
exitLongCondition = close < highStop
// Funktion zur Berechnung der Menge
calc_qty(mode, riskMultiplier) =>
lowestClose = ta.lowest(close, 1560)
if mode == "Exponential"
qty = riskMultiplier / lowestClose * 1000 * strategy.equity / strategy.initial_capital
else
qty = riskMultiplier / lowestClose * 1000
// Berechnung der Menge basierend auf der Benutzerwahl
qty = calc_qty(calcMode, riskMultiplier)
// Execute strategy
if (longCondition)
strategy.entry("Long", strategy.long, qty=qty)
alert("Buy Signal", alert.freq_once_per_bar_close)
if (exitLongCondition)
strategy.close("Long")
alert("Sell Signal", alert.freq_once_per_bar_close)
// Plotting
plotshape(series=longCondition, location=location.belowbar, color=#0097a7, style=shape.triangleup, size=size.small, title="Buy Signal")
plotshape(series=ta.crossunder(close, highStop), location=location.abovebar, color=#ff195f, style=shape.triangledown, size=size.small, title="Sell Signal")
plot(sma21, color=color.gray)
plot(highStop, color=#0097a7)
plot(lowStop, color=#ff195f)