돈치안 채널 적응 트렌드 전략

저자:차오장, 날짜: 2023-10-26 15:58:52
태그:

img

전반적인 설명

이 전략은 동치안 채널 지표를 사용하여 트렌드 거래를 위해 시장 추세를 적응적으로 추적합니다. 가격이 동치안 채널을 통과 할 때 추세를 따라가며 가격이 채널로 다시 떨어지면 손실을 줄입니다.

전략 논리

  1. 특정 기간 동안 가장 높고 가장 낮은 낮은 것을 계산하여 돈치안 채널을 형성합니다. 채널의 중간선은 가장 높고 가장 낮은 평균입니다.

  2. 가격이 채널의 상단 범위를 넘어서면 긴 포지션을 개척합니다. 가격이 하단 범위를 넘어서면 짧은 포지션을 개척합니다.

  3. 포지션을 열면 스톱 로스는 채널의 중간선을 추적합니다. 수익을 취하면 가격이 특정 비율로 채널을 벗어납니다.

  4. 손실을 줄이고 가격이 채널로 떨어지면 포지션을 닫습니다.

이점 분석

  1. 이 전략은 동치안 채널을 활용하여 트렌드 방향을 결정하고 급격히 브레이크오웃을 포착합니다.

  2. 채널 중간선을 사용해서 손해를 막는 것은 수익을 보호합니다.

  3. 이윤 목표가 사용자 정의 취득 이윤 비율에 따라 증폭됩니다.

  4. 그것은 통합, 브레이크아웃, 인하 등과 같은 다른 시장 조건에 적응하고 유연하게 위치 크기를 조정합니다.

  5. 간단하고 명확한 거래 논리, 이해하기 쉽고 마스터하기 쉽습니다.

위험 분석

  1. 이 전략은 브레이크오웃만 거래하고 통합을 효과적으로 처리할 수 없습니다.

  2. 거짓 파업 신호의 위험이 존재하고, 확인을 위해 필요한 다른 지표

  3. 부적절한 스톱 로스 및 수익 취득 설정은 조기 종료 또는 불충분한 이익으로 이어질 수 있습니다.

  4. 잘못된 채널 기간 설정은 거래 신호의 정확성에 영향을 미칩니다.

  5. 과도한 포지션 사이징은 시장 변동 위험을 증폭시킵니다.

  6. 예상치 못한 로봇 중단 위험은 시스템 신뢰성을 보장합니다.

개선 방향

  1. 부진을 피하기 위해 부피 표시기를 추가합니다.

  2. 트렌드 지표 필터를 늘려 입력 신호의 정확도를 높여

  3. 동적 스톱 로스 및 수익 알고리즘을 최적화합니다.

  4. 실시간 시장 조건에 따라 포지션 사이즈 전략을 조정합니다.

  5. 더 나은 출입 시기를 위해 하루 동안과 시장 이전 데이터를 조사합니다.

  6. 최적의 조합을 찾기 위해 다른 매개 변수 기간을 테스트합니다.

  7. 모델 검증을 추가하여 과잉 부착을 방지합니다.

결론

전체적으로 이것은 간단하고 실용적인 적응 트렌드 다음 전략이다. 트렌드 브레이크를 빠르게 캡처하고 이익을 보호하는 등의 장점이 있다. 또한 통합 중에 비효율성과 가짜 브레이크로 인한 손실과 같은 단점이 있다. 미래의 개선은 더 많은 시그널 필터링, 동적 스톱 로스/프로프트를 통합하여 더 많은 시장 조건에 적응하는 데 있다.


/*backtest
start: 2022-10-19 00:00:00
end: 2023-10-25 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//Noro
//2020

//@version=4
strategy(title = "Noro's Donchian Strategy", shorttitle = "Donchian str", overlay = true, default_qty_type = strategy.percent_of_equity, initial_capital = 100, default_qty_value = 100, commission_value = 0.1)

//Settings
needlong = input(true, defval = true, title = "Long")
needshort = input(true, defval = true, title = "Short")
tp = input(defval = 10, minval = 1, title = "Take profit")
lotsize = input(100, defval = 100, minval = 1, maxval = 10000, title = "Lot, %")
pclen = input(50, minval = 1, title = "Price Channel Length")
showll = input(true, defval = true, title = "Show lines")
showbg = input(false, defval = false, title = "Show Background")
showof = input(true, defval = true, title = "Show Offset")
fromyear = input(1900, defval = 1900, minval = 1900, maxval = 2100, title = "From Year")
toyear = input(2100, defval = 2100, minval = 1900, maxval = 2100, title = "To Year")
frommonth = input(01, defval = 01, minval = 01, maxval = 12, title = "From Month")
tomonth = input(12, defval = 12, minval = 01, maxval = 12, title = "To Month")
fromday = input(01, defval = 01, minval = 01, maxval = 31, title = "From day")
today = input(31, defval = 31, minval = 01, maxval = 31, title = "To day")

//Price Channel
h = highest(high, pclen)
l = lowest(low, pclen)
center = (h + l) / 2
tpl = h * (100 + tp) / 100
tps = l * (100 - tp) / 100

//Lines
tpcol = showll ? color.lime : na
pccol = showll ? color.blue : na
slcol = showll ? color.red : na
offset = showof ? 1 : 0
plot(tpl, offset = offset, color = tpcol, title = "TP Long")
plot(h, offset = offset, color = pccol, title = "Channel High")
plot(center, offset = offset, color = slcol, title = "Cannel Center")
plot(l, offset = offset, color = pccol, title = "Channel Low")
plot(tps, offset = offset, color = tpcol, title = "TP Short")

//Background
size = strategy.position_size
bgcol = showbg == false ? na : size > 0 ? color.lime : size < 0 ? color.red : na
bgcolor(bgcol, transp = 70)

//Trading
truetime = time > timestamp(fromyear, frommonth, fromday, 00, 00) and time < timestamp(toyear, tomonth, today, 23, 59)
lot = 0.0
lot := size != size[1] ? strategy.equity / close * lotsize / 100 : lot[1]
mo = 0
mo := strategy.position_size != 0 ? 0 : high >= center and low <= center ? 1 : mo[1]
if h > 0
    strategy.entry("Long", strategy.long, lot, stop = h, when = strategy.position_size <= 0 and needlong and truetime and mo)
    strategy.exit("TP Long", "Long", limit = tpl, stop = center)
    strategy.entry("Short", strategy.short, lot, stop = l, when = strategy.position_size >= 0 and needshort and truetime and mo)
    strategy.exit("TP Short", "Short", limit = tps, stop = center)
if time > timestamp(toyear, tomonth, today, 23, 59)
    strategy.close_all()
    strategy.cancel("Long")
    strategy.cancel("Short")

더 많은