
골드 크로스 켈트 채널 트렌드 추적 전략은 트렌드 방향에만 거래하는 전략이다. 그것은 이동 평균 골드 크로스와 켈트 채널을 입시 신호로 사용하여 트렌드 방향을 포착한다.
이 전략은 트렌드 방향을 판단하기 위해 두 가지 이동 평균, 즉 단기 이동 평균과 장기 이동 평균을 사용하여 황금 십자가와 죽음의 십자가를 형성합니다. 동시에, 사용자가 정의한 배수를 사용하여 켈트 통로의 상하 궤도를 그리며, 가격이 통로를 돌파 할 때 거래 신호를 냅니다.
구체적으로, 전략은 먼저 장기 이동 평균이 단기 이동 평균 위에 있는지 판단하고, 만약 그렇다면, 금으로 교차하고, 추세로 판단한다. 단기 이동 평균이 장기 이동 평균 아래에 있다면, 사망으로 교차하고, 추세로 판단한다.
트렌드 판단에 기초하여, 가격이 상도를 돌파하면, 다중 신호를 생성한다. 가격이 하도를 돌파하면, 하위 신호를 생성한다. 사용자는 이동 평균 주기 및 채널 폭을 스스로 조정하여 전략의 파라미터를 조정할 수 있다.
진입 후, 전략은 사용자 정의 된 스톱 스톱 손실 ATR 배수를 사용하여 스톱 스톱 손실 수준을 설정합니다. 동시에, 전략은 추가적으로 브레이크 스톱 스톱 및 스톱 손실 조건을 제공하여 포지션을 더 유연하게 제어 할 수 있습니다.
이 전략은 트렌드 추적과 채널 브레이크의 장점을 결합하여 시장의 흐름을 효과적으로 판단하고 트렌드 기회를 잡을 수 있습니다. 구체적인 장점은 다음과 같습니다:
골드 크로스 (Gold Cross) 를 사용하여 트렌드 방향을 판단하여 큰 트렌드에 부합하지 않는 노이즈 거래를 효과적으로 필터링 할 수 있습니다.
켈트 통로 돌파는 추세 방향 판단과 결합하여 시장 진입의 시간 정확도를 향상시킬 수 있습니다.
스톱 스톱 손실 메커니즘은 수익을 잠금하고 위험을 적극적으로 제어 할 수 있습니다.
전략의 매개 변수는 다양한 품종과 시장 환경에 따라 유연하게 조정할 수 있습니다.
동시에 더 많은 공백을 수행하여 전략 적용 범위를 확장 할 수 있습니다.
이 전략은 많은 장점들을 가지고 있지만, 몇 가지 위험도 있습니다.
하지만, 이 모든 것은, 이 모든 것은, 이 모든 것은, 이 모든 것은, 이 모든 것은.
만약 큰 흐름이 바뀌면 역전적 손실의 위험이 발생할 수 있다.
잘못된 매개 변수 설정으로 인해 너무 느슨하거나 너무 자주 거래 될 수 있습니다.
하지만, 이 모든 것은 위험입니다.
은 은 은 은
이에 대해, 변수 최적화, 적절한 이동 평균 주기 조정, 또는 적절히 포지션 크기를 축소하여 위험을 줄일 수 있다.
이 전략에는 더 많은 최적화 가능성이 있습니다:
더 많은 판단 지표를 추가하여 다중 인자 모델을 형성하고 전략의 정확성을 향상시킬 수 있습니다. 예를 들어, MACD, RSI 등이 포함됩니다.
기계 학습에 기반하여 매개 변수를 최적화하여 다른 시장 환경에 더 적합하게 만들 수 있습니다.
동적으로 스톱 스톱 손실 조건을 조정하여 수익을 보장하는 조건에서 더 큰 수익을 추구하는 것을 고려할 수 있습니다.
변동율의 변화에 따라 포지션 규모를 조정할 수 있다.
다양한 품종의 변수 선호를 연구하고, 다양한 품종에 적합한 변수 조합을 개발한다.
거래 요금의 영향을 줄이기 위해 거래 빈도를 낮추는 메커니즘을 추가하십시오.
골드 크로스 켈트 채널 트렌드 추적 전략은 전체적으로 비교적 안정적이고 신뢰할 수 있는 트렌드 추적 전략이다. 트렌드 판단과 채널 브레이크의 장점을 결합하여 시장 트렌드 방향을 효과적으로 식별하고 높은 확률의 거래 기회를 선택할 수 있다. 매개 변수 최적화 및 메커니즘 개선으로 이 전략은 강력한 수치 거래 도구가 될 수 있다.
/*backtest
start: 2022-10-26 00:00:00
end: 2023-11-01 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © OversoldPOS
//@version=5
// strategy("Keltner Channel Strategy by OversoldPOS", overlay=true,initial_capital = 100000,default_qty_type = strategy.percent_of_equity,default_qty_value = 10, commission_type = strategy.commission.cash_per_order, commission_value = 7)
// Parameters
length = input(21, title="MA Length")
Entrymult = input(1, title="Entry ATR")
profit_mult = input(4, title="Profit Taker")
exit_mult = input(-1, title="Exit ATR")
// Moving Average Type Input
ma_type = input.string("SMA", title="Moving Average Type", options=["SMA", "EMA", "WMA"])
// Calculate Keltner Channels for different ATR multiples
atr_value = ta.atr(length)
basis = switch ma_type
"SMA" => ta.sma(close, length)
"EMA" => ta.ema(close, length)
"WMA" => ta.wma(close, length)
//
EntryKeltLong = basis + Entrymult * ta.atr(10)
EntryKeltShort = basis - Entrymult * ta.atr(10)
upper_channel1 = basis + 1 * ta.atr(10)
lower_channel1 = basis - 1 * ta.atr(10)
upper_channel2 = basis + 2 * ta.atr(10)
lower_channel2 = basis - 2 * ta.atr(10)
upper_channel3 = basis + 3 * ta.atr(10)
lower_channel3 = basis - 3 * ta.atr(10)
upper_channel4 = basis + 4 * ta.atr(10)
lower_channel4 = basis - 4 * ta.atr(10)
// Entry condition parameters
long_entry_condition = input(true, title="Long Positions")
short_entry_condition = input(true, title="Enable Short Positions")
// Additional conditions for long and short entries
is_long_entry = ta.ema(close, 20) > ta.ema(close, 50)
is_short_entry = ta.ema(close, 20) < ta.ema(close, 50)
// Additional conditions for long and short entries
MAShort = input(50, title="Short MA for Golden Cross")
MALong = input(200, title="Long MA for Golden Cross")
is_long_entry2 = ta.ema(close, MAShort) > ta.ema(close, MALong)
is_short_entry2 = ta.ema(close, MAShort) < ta.ema(close, MALong)
// Exit condition parameters
long_exit_condition1_enabled = input(true, title="Enable Long Profit Taker")
long_exit_condition2_enabled = input(true, title="Enable Long Stop")
short_exit_condition1_enabled = input(true, title="Enable Short Profit Taker")
short_exit_condition2_enabled = input(true, title="Enable Short Stop")
// Take Profit condition parameters
take_profit_enabled = input(true, title="Enable Take Profit Condition")
Takeprofit = basis + profit_mult * atr_value
STakeprofit = basis - profit_mult * atr_value
// Long entry condition
long_condition = long_entry_condition and ta.crossover(close, EntryKeltLong) and is_long_entry2
// Short entry condition
short_condition = short_entry_condition and ta.crossunder(close, EntryKeltShort) and is_short_entry2
// Exit conditions
long_exit_condition1 = long_exit_condition1_enabled and close > Takeprofit
long_exit_condition2 = long_exit_condition2_enabled and close < basis + exit_mult * atr_value
short_exit_condition1 = short_exit_condition1_enabled and close < STakeprofit
short_exit_condition2 = short_exit_condition2_enabled and close > basis - exit_mult * atr_value
// Strategy logic
if (long_condition)
strategy.entry("Long", strategy.long)
if (short_condition)
strategy.entry("Short", strategy.short)
if (long_exit_condition1 or long_exit_condition2)
strategy.close("Long")
if (short_exit_condition1 or short_exit_condition2)
strategy.close("Short")
// Moving Averages
var float MA1 = na
var float MA2 = na
if (ma_type == "SMA")
MA1 := ta.sma(close, MAShort)
MA2 := ta.sma(close, MALong)
else if (ma_type == "EMA")
MA1 := ta.ema(close, MAShort)
MA2 := ta.ema(close, MALong)
else if (ma_type == "WMA")
MA1 := ta.wma(close, MAShort)
MA2 := ta.wma(close, MALong)
// Plotting Keltner Channels with adjusted transparency
transparentColor = color.rgb(255, 255, 255, 56)
plot(upper_channel1, color=transparentColor, title="Upper Channel 1")
plot(lower_channel1, color=transparentColor, title="Lower Channel 1")
plot(upper_channel2, color=transparentColor, title="Upper Channel 2")
plot(lower_channel2, color=transparentColor, title="Lower Channel 2")
plot(upper_channel3, color=transparentColor, title="Upper Channel 3")
plot(lower_channel3, color=transparentColor, title="Lower Channel 3")
plot(upper_channel4, color=transparentColor, title="Upper Channel 4")
plot(lower_channel4, color=transparentColor, title="Lower Channel 4")
plot(basis, color=color.white, title="Basis")
plot(MA1, color=color.rgb(4, 248, 216), linewidth=2, title="Middle MA")
plot(MA2, color=color.rgb(220, 7, 248), linewidth=2, title="Long MA")