동적 가격 채널 거래 전략

저자:차오장, 날짜: 2023-09-16 19:01:26
태그:

전반적인 설명

이 문서에서는 동적 가격 채널을 기반으로 한 단기 거래 전략을 소개합니다. 동적 가격 채널을 계산하고 채널 브레이크에서 거래를 통해 트렌드 방향을 판단합니다.

전략 논리

이 전략은 다음과 같은 논리에 기초합니다.

  1. 가장 높은 가격과 가장 낮은 가격을 사용하여 동적 가격 채널을 계산합니다. 상단대는 가장 높은 가격과 채널 중점의 평균입니다. 하단대는 가장 낮은 가격과 중점의 차이를 빼는 중점입니다.

  2. 가격이 상위 범위를 넘으면 상승 추세가 시작됩니다. 가격이 하위 범위를 넘으면 하락 추세가 시작됩니다.

  3. 상승 추세에서 두 개의 연속 하락 바가 나타나면 장거리. 하락 추세에서는 두 개의 연속 상승 바가 나타나면 단거리.

  4. 시장 동력을 쫓기 위해 반대 트렌드 항목을 고려하십시오. 예를 들어, 상승 트렌드에서 짧고 하락 트렌드에서 길습니다.

  5. 수익을 확보하기 위해 입시 가격의 x%와 같은 수익률을 설정합니다.

이점 분석

이 전략의 장점은 다음과 같습니다.

  1. 동적 채널은 더 나은 트렌드 판단을 위해 실시간 시장 변화를 반영합니다.

  2. 트렌드와 브레이크를 결합하면 가짜 브레이크를 필터링할 수 있습니다.

  3. 반동향 엔트리는 초과 수익을 얻기 위해 시장 동력을 활용합니다.

  4. 수익을 취하는 것은 위험을 효과적으로 통제합니다.

  5. 논리는 간단하고 명확해서 쉽게 구현할 수 있습니다.

위험 분석

또한 고려해야 할 몇 가지 위험이 있습니다.

  1. 변동적인 시장에서 채널이 고장날 수 있습니다.

  2. 역동 트렌드 거래는 손실에 취약합니다. 손실 크기를 제어합니다.

  3. 가짜 브레이크는 나쁜 거래를 일으킬 수 있습니다. 트렌드를 통해 타당성을 확인하세요.

  4. 비용 조절을 위해 과잉 거래를 피하십시오.

결론

이 전략은 동적인 채널, 브레이크아웃 및 수익을 통합합니다. 적절한 조정으로 효과적인 단기 거래 도구가 될 수 있습니다. 그러나 거래자는 위험 통제를 유의하고 자신의 스타일에 맞게 조정해야합니다.


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


//@version=2
strategy("Noro's Bands Scalper Strategy v1.1", shorttitle = "Scalper str 1.1", overlay=true, default_qty_type = strategy.percent_of_equity, default_qty_value=100.0, pyramiding=0)

//Settings
needlong = input(true, defval = true, title = "Long")
needshort = input(true, defval = true, title = "Short")
takepercent = input(0, defval = 0, minval = 0, maxval = 1000, title = "take, %")
needct = input(false, defval = false, title = "Counter-trend entry")
len = input(20, defval = 20, minval = 2, maxval = 200, title = "Period")
needbb = input(true, defval = true, title = "Show Bands")
needbg = input(true, defval = true, title = "Show Background")
src = close

//PriceChannel
lasthigh = highest(src, len)
lastlow = lowest(src, len)
center = (lasthigh + lastlow) / 2

//Distance
dist = abs(src - center)
distsma = sma(dist, len)
hd = center + distsma
ld = center - distsma
hd2 = center + distsma * 2
ld2 = center - distsma * 2

//Trend
sma = sma(close, 20)
smatrend = close > sma ? 1 : close < sma ? -1 : smatrend[1]
trend = close < ld and high < hd ? -1 : close > hd and low > ld ? 1 : trend[1]

//Lines
colo = needbb == false ? na : black
plot(hd, color = colo, linewidth = 1, transp = 0, title = "High band")
plot(center, color = colo, linewidth = 1, transp = 0, title = "center")
plot(ld, color = colo, linewidth = 1, transp = 0, title = "Low band")

//Background
col = needbg == false ? na : trend == 1 ? lime : red
bgcolor(col, transp = 80)

//Signals
bar = close > open ? 1 : close < open ? -1 : 0
up7 = trend == 1 and bar == -1 and bar[1] == -1 ? 1 : 0
dn7 = trend == 1 and bar == 1 and bar[1] == 1 and close > strategy.position_avg_price * (100 + takepercent) / 100 ? 1 : 0
up8 = trend == -1 and bar == -1 and bar[1] == -1 and close < strategy.position_avg_price * (100 - takepercent) / 100 ? 1 : 0
dn8 = trend == -1 and bar == 1 and bar[1] == 1 ? 1 : 0

if up7 == 1 or up8 == 1
    strategy.entry("Long", strategy.long, needlong == false ? 0 : trend == -1 and needct == false ? 0 : na)

if dn7 == 1 or dn8 == 1
    strategy.entry("Short", strategy.short, needshort == false ? 0 : trend == 1 and needct == false ? 0 : na)

더 많은