단일 측면 트렌드 쇼크 브레이크 전략

저자:차오장, 날짜: 2024-01-18 14:59:30
태그:

img

전반적인 설명

단일 측면 트렌드 쇼크 브레이크 아웃 전략은 가격 채널과 트렌드 판단을 활용한 브레이크 아웃 전략이다. 트렌드 방향을 파악하고, 범위 제한 기간 동안 브레이크 아웃에 들어가 수익 목표가 달성되면 종료하는 것을 목표로합니다.

전략 논리

전략은 최근 N 기간 동안 가장 높고 가장 낮은 가격을 사용하여 가격 채널의 상위 및 하위 대역을 계산합니다. 그 다음 가격 중간선을 계산합니다. 채널 대역을 얻기 위해 가격과 중간 사이의 거리는 평균됩니다.

트렌드 검출을 위해, 전략은 최근 촛불이 모두 채널 위 (승향) 또는 아래 (하락) 에 닫혀 있는지 확인합니다. 트렌드 확인 후, 그것은 대역 근처의 가격 충격을 기다리고 역 방향으로 진입합니다.

몸의 길이가 평균 몸의 길이의 배수를 초과할 때 몸의 파업은 입시 신호를 보완합니다. 전략은 입시 후 수익 목표를 설정하고 가격이 도달하면 수익을 취합니다.

이점 분석

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

  1. 가격 채널 필터는 잘못된 파업 위험을 줄여줍니다.
  2. 리버스 엔트리는 트렌드 쇼크로부터 이익을 얻습니다.
  3. 몸 밖으로 빠져나오는 것은 진입의 정확도를 향상시킵니다.
  4. 이윤 목표가 적극적으로 이익을 취득 할 수 있습니다.

위험 분석

또한 몇 가지 위험이 있습니다.

  1. 잘못된 채널 매개 변수는 채널을 과도하게 넓히거나 좁힐 수 있습니다.
  2. 강한 추세에 반하는 것은 큰 손실로 이어질 수 있습니다.
  3. 몸의 파열은 위쪽에 잘못된 신호를 생성하는 경향이 있습니다.
  4. 엄격한 수익 목표가 테이블에 수익을 남길 수 있습니다.

이러한 문제는 매개 변수 조정, 강한 트렌드 중 반전을 피하고, 출구 논리를 최적화하는 등으로 해결할 수 있습니다.

더 나은 기회

전략을 개선할 수 있는 몇 가지 방법:

  1. 트렌드를 확인하기 위해 트렌드 지표를 추가합니다
  2. 잘못된 신호를 줄이기 위해 몸의 탈출 매개 변수를 최적화
  3. 입력 시점에 대한 추가 필터
  4. 수익 목표의 동적 조정

결론

싱글 사이드 트렌드 쇼크 브레이크아웃 전략은 다양한 기간에 트렌드에 대한 브레이크아웃에서 이익을 얻습니다. 트렌드 식별 및 적극적인 수익 취득의 장점이 있지만 일부 위험도 있습니다. 이러한 위험은 멀티 팩터 확인, 매개 변수 최적화 등을 통해 줄일 수 있습니다. 이 전략은 단기 거래에 적합하며 트렌드를 따르는 전략을 보완 할 수 있습니다.


/*backtest
start: 2024-01-10 00:00:00
end: 2024-01-17 00:00:00
period: 3m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/


//@version=2
strategy("Noro's Bands Scalper Strategy v1.5", shorttitle = "Scalper str 1.5", 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, %")
needbe = input(true, defval = true, title = "Bands Entry")
needct = input(false, defval = false, title = "Counter-trend entry")
bodylen = input(10, defval = 10, minval = 0, maxval = 50, title = "Body length")
trb = input(1, defval = 1, minval = 1, maxval = 5, title = "Trend bars")
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 1
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
chd = close > hd
cld = close < ld
uptrend = trb == 1 and chd ? 1 : trb == 2 and chd and chd[1] ? 1 : trb == 3 and chd and chd[1] and chd[2] ? 1 : trb == 4 and chd and chd[1] and chd[2] and chd[3] ? 1 : trb == 5 and chd and chd[1] and chd[2] and chd[3] and chd[4] ? 1 : 0
dntrend = trb == 1 and cld ? 1 : trb == 2 and cld and cld[1] ? 1 : trb == 3 and cld and cld[1] and cld[2] ? 1 : trb == 4 and cld and cld[1] and cld[2] and cld[3] ? 1 : trb == 5 and cld and cld[1] and cld[2] and cld[3] and cld[4] ? 1 : 0
trend = dntrend == 1 and high < center ? -1 : uptrend == 1 and low > center ? 1 : trend[1]

//trend = close < ld and high < center ? -1 : close > hd and low > center ? 1 : trend[1]

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

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

//Body
body = abs(close - open)
smabody = ema(body, 30) / 10 * bodylen

//Signals
bar = close > open ? 1 : close < open ? -1 : 0
up7 = trend == 1 and ((bar == -1 and bar[1] == -1) or (body > smabody and bar == -1)) ? 1 : 0
dn7 = trend == 1 and ((bar == 1 and bar[1] == 1) or (close > hd and needbe == true)) and close > strategy.position_avg_price * (100 + takepercent) / 100 ? 1 : 0
up8 = trend == -1 and ((bar == -1 and bar[1] == -1) or (close < ld2 and needbe == true)) and close < strategy.position_avg_price * (100 - takepercent) / 100 ? 1 : 0
dn8 = trend == -1 and ((bar == 1 and bar[1] == 1) or (body > smabody and bar == 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)

더 많은