
이 전략은 산호 트렌드 지표의 교차에 기반한 중기기간의 거래 전략이다. 이 전략은 잠재적인 구매 기회를 식별하기 위해 두 개의 다른 파라미터의 산호 트렌드 라인을 사용합니다. 이 전략은 주로 1 개월 또는 3 개월 차트와 같은 더 긴 기간에 적용되며, 큰 추세에서 유리한 구매 지점을 잡기 위해 고안되었습니다.
전략의 핵심은 두 개의 산호 트렌드 라인을 사용하는 것입니다. 각각 산호 트렌드 1과 산호 트렌드 2입니다. 각 트렌드 라인은 지수 이동 평균 (EMA) 계산에 기반하고 추가적인 부드러운 처리를 추가합니다. 산호 트렌드 1 라인이 산호 트렌드 2 라인을 아래에서 통과하면 시스템이 구매 신호를 냅니다. 이러한 교차는 잠재적인 상승 트렌드의 시작으로 간주됩니다.
이 전략의 핵심 요소는 다음과 같습니다.
이러한 매개 변수를 조정함으로써 거래자는 다양한 시장 조건과 개인 선호도에 따라 전략의 성능을 최적화 할 수 있습니다.
이중 산호 트렌드 크로스 전략은 중·장기 시장의 추세를 포착하기 위한 효과적인 도구이다. 두 개의 다른 파라미터의 산호 트렌드 라인의 교차를 이용함으로써, 이 전략은 안정성을 유지하면서도, 다양한 시장 환경에 적응할 수 있다. 지연성 및 가짜 돌파구와 같은 몇 가지 고유한 위험이 존재하지만, 신중한 파라미터 최적화 및 추가 위험 관리 조치를 통해, 거래자는 전략의 신뢰성과 수익성을 크게 향상시킬 수 있다.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-09-24 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("D-Stryker LT", overlay=true)
// Input settings for Coral Trend 1
smoothingPeriod1 = input.int(3, title="Coral Trend 1 Smoothing Period")
constantD1 = input.float(0.2, title="Coral Trend 1 Constant D")
// Input settings for Coral Trend 2
smoothingPeriod2 = input.int(6, title="Coral Trend 2 Smoothing Period")
constantD2 = input.float(0.2, title="Coral Trend 2 Constant D")
// Function to calculate Coral Trend
coralTrend(source, smoothingPeriod, constantD) =>
emaValue = ta.ema(source, smoothingPeriod)
smoothEma = ta.ema(emaValue, smoothingPeriod)
trendLine = smoothEma + constantD * (emaValue - smoothEma)
trendLine
// Calculate Coral Trends
coralTrend1 = coralTrend(close, smoothingPeriod1, constantD1)
coralTrend2 = coralTrend(close, smoothingPeriod2, constantD2)
// Plot Coral Trends
plot(coralTrend1, title="Coral Trend 1", color=color.blue, linewidth=2)
plot(coralTrend2, title="Coral Trend 2", color=color.red, linewidth=2)
// Generate buy signal when Coral Trend 1 crosses above Coral Trend 2
buySignal = ta.crossover(coralTrend1, coralTrend2)
// Plot buy signals on the chart
plotshape(series=buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
// Optional: Add strategy entry and exit logic
if (buySignal)
strategy.entry("Buy", strategy.long)