ZZ-4 가격 채널 파업 전략

저자:차오장, 날짜: 2023-09-21 10:59:55
태그:

전반적인 설명

이 전략은 ZZ 지표의 가격 채널을 기반으로 거래하며, 가격이 채널 범위를 넘어서거나 아래로 돌파할 때 긴/단기 포지션을 취합니다. 이 전략은 채널 범위를 벗어나는 트렌드 돌파 움직임을 포착하는 것을 목표로합니다.

전략 논리

  1. 가격 채널 상부/하부 대역을 계산
  2. 가격이 상위 범위를 넘을 때 길게 가십시오.
  3. 가격이 하위 범위를 넘어갈 때 짧은 이동
  4. 거래 시간 범위 설정
  5. 매일 종료 전 순환 포지션

특히, ZZ 지표를 사용하여 가격 채널 대역을 계산합니다. 가격이 하위 대역에서 상승 할 때, 길게 가십시오. 가격이 상위 대역에서 떨어지면 짧게 가십시오. 중지 손실 주문은 채널 대역과 함께 중지 손실 수준으로 사용됩니다. 거래 시간은 또한 하루 종일 위험을 피하기 위해 정의됩니다.

이점 분석

  1. 가격 채널은 잠재적인 트렌드 브레이크를 식별합니다.
  2. 단순하고 명확한 거래 신호
  3. 사용자 정의 가능한 채널 기간은 다른 제품과 사이클에 적합합니다.
  4. 거래 시간 및 매일 출출 위험 관리
  5. 스톱 손실 제한 단 거래 손실

위험 분석

  1. 채널 내부의 윙사우가 반복적으로 스톱 손실을 칠 수 있습니다.
  2. 적시에 매개 변수를 조정해야 합니다. 그렇지 않으면 채널 범위가 정확하지 않을 수 있습니다.
  3. 탈출은 거짓일 수 있고, 함락될 위험이 있습니다.
  4. 수익 잠재력은 채널 범위에 따라 제한됩니다.
  5. 트렌드 움직임을 완전히 활용하지 못합니다.

위험은 채널 범위를 넓히고, 스톱 로스를 최적화하고, 트렌드 강도를 측정함으로써 감소 할 수 있습니다.

최적화 방향

  1. 최적의 설정을 위해 다른 매개 변수 조합을 테스트
  2. 더 큰 움직임을 포착하기 위해 가격 채널을 확장
  3. 잘못된 파장을 피하기 위해 트렌드 지표를 추가합니다.
  4. 포착되는 것을 방지하기 위해 중지 손실을 최적화
  5. 브레이크오웃 수익을 극대화하기 위해 포지션 크기를 늘려
  6. 다른 날짜 범위에서 수익성을 평가

요약

이 전략은 트렌드 돌발을 식별하기 위해 가격 채널 브레이크오웃을 거래합니다. 장점은 간단한 명확한 신호와 쉬운 조작입니다; 단점은 윙사와 트렌드를 타지 못하는 것입니다. 매개 변수 최적화와 전략 조합은 장점을 유지하면서 단점을 극복 할 수 있습니다. 거래자가 가격 채널 기술을 적용하는 것을 마스터하는 데 도움이됩니다.


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

//Noro
//2019

//@version=4
strategy(title = "Noro's ZZ-4 Strategy", shorttitle = "Noro's ZZ-4 Strategy", overlay = true, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, pyramiding = 0)

//Settings
needlong = input(true, defval = true, title = "Long")
needshort = input(true, defval = true, title = "Short")
capital = input(100, defval = 100, minval = 1, maxval = 10000, title = "Capital, %")
len = input(7, minval = 1, title = "Length")
showll = input(true, defval = true, title = "Show Levels")
showbg = input(false, defval = false, title = "Show Background")
showpc = input(false, defval = false, title = "Show Price Channel")
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(ohlc4, len)
l = lowest(ohlc4, len)
pccol = showpc ? color.blue : na
plot(h, color = pccol, transp = 0)
plot(l, color = pccol, transp = 0)

//Levels
ml = 0
ml := l > l[1] ? 1 : l < l[1] ? -1 : ml[1]
ll = 0.0
ll := ml == 1 and ml[1] == -1 ? l[1] : ll[1]
mh = 0
mh := h > h[1] ? 1 : h < h[1] ? -1 : mh[1]
hl = 0.0
hl := mh == -1 and mh[1] == 1 ? h[1] : hl[1]

//Lines
colorh = showll and hl == hl[1] ? color.lime : na
colorl = showll and ll == ll[1] ? color.red : na
plot(hl, color = colorh, linewidth = 2, transp = 0, title = "Long")
plot(ll, color = colorl, linewidth = 2, transp = 0, title = "Short")

//Background
size = strategy.position_size
trend = 0
trend := size > 0 ? 1 : size < 0 ? -1 : high >= hl ? 1 : low <= ll ? -1 : trend[1]
bgcol = showbg == false ? na : trend == 1 ? color.lime : trend == -1 ? color.red : na
bgcolor(bgcol, transp = 80)

//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 * capital / 100 : lot[1]
if ll > 0 and hl > 0
    strategy.entry("Long", strategy.long, needlong == false ? 0 : lot, stop = hl, when=(truetime))
    strategy.entry("Short", strategy.short, needshort == false ? 0 : lot, stop = ll, when=(truetime))
if time > timestamp(toyear, tomonth, today, 23, 59)
    strategy.close_all()
    strategy.cancel("Long")
    strategy.cancel("Short")

더 많은