Ketner 채널 손절매 및 손절매 전략


생성 날짜: 2023-09-15 14:41:46 마지막으로 수정됨: 2023-09-15 14:41:46
복사: 0 클릭수: 801
avatar of ChaoZhang ChaoZhang
1
집중하다
1617
수행원

전략 개요

크트너 채널 스톱스트로프 전략은 크트너 채널 분석 방법에 기반하여 스톱스트로프 규칙을 추가하여 거래 결정을 최적화하는 양적 전략이다. 이 전략은 채널의 상승과 하락의 관계를 모니터링하며, 돌파구가 발생했을 때 더 많은 하락 방향을 선택하고, 최적의 스톱스트로프 포인트에 따라 위험과 수익의 균형을 이룬다.

전략 원칙

  1. 크트너 통로의 중간 궤도, 상단 궤도 및 하단 궤도를 계산한다.

  2. 가격이 상행선을 터치할 때 더 많은 기회를 고려하고, 하행선을 터치할 때 공백 기회를 고려한다.

  3. 가격 돌파 경로 상반기 때 입장이 더 많이; 돌파 경로 하반기 때 입장이 빈다.

  4. 스톱포인트는 입점 가격이 상승하는 비율을 설정하고, 스톱포인트는 입점 가격이 떨어지는 비율을 설정한다.

이 전략의 장점은 스톱 스톱 손해 규칙을 도입하여, 흐름이 지나치게 큰 손실이 발생했을 때 적시에 중지하고, 파동이 끝날 때까지 적시에 중지하는 것이다. 또한 재입장 신호를 제공하여, 지속 가능한 트렌드 거래에 참여한다.

매개 변수는 다양한 품종에 따라 최적의 위험과 이익의 균형을 달성하기 위해 최적화 할 수 있습니다.

전략적 이점

  • 카트나 통로가 추세를 판단하는 방법

  • 스톱스톱스피스피트 최적화 수익

  • 은 출입구, 가짜 돌파구를 피하기

  • 정책의 유연성, 변수 조정

  • 다른 지표와 함께 사용할 수 있다

위험 경고

  • 제휴를 중단하는 비율을 적절히 높여야 합니다.

  • 하지만 여전히 손실의 위험이 있습니다.

  • 통로가 뚫려 손실이 발생할 수 있다.

  • 너무 작은 정지 손실은 빈번한 정지를 초래할 수 있습니다.

요약하다

커트너 채널 스톱 스톱 손실 전략은 전통적인 채널 거래에 최적화되어 트렌드를 추적하면서 거래 위험을 제어합니다. 반복적인 재검토와 매개 변수 조정을 통해 좋은 전략 효과를 얻을 수 있습니다. 이 전략은 깊이 있는 연구와 실험 검증을 통해 전략의 안정성을 점차적으로 향상시킬 수 있습니다.

전략 소스 코드
/*backtest
start: 2023-08-15 00:00:00
end: 2023-08-23 00:00:00
period: 2h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
strategy(title="Optimized Keltner Channels Strategy for BTC", overlay=true)
length = input(9, minval=1)
mult = input(1.0, "Multiplier")
src = input(close, title="Source")
exp = input(true, "Use Exponential MA")
BandsStyle = input("Average True Range", options = ["Average True Range", "True Range", "Range"], title="Bands Style")
atrlength = input(18, "ATR Length")
sl = input(defval=22, minval=0, title="Stop Loss (%)")
tp = input(defval=21, minval=0, title="Take Profit (%)")

esma(source, length)=>
	s = sma(source, length)
	e = ema(source, length)
	exp ? e : s
ma = esma(src, length)
rangema = BandsStyle == "True Range" ? rma(tr(true), length) : BandsStyle == "Average True Range" ? atr(atrlength) : rma(high - low, length)
upper = ma + rangema * mult
lower = ma - rangema * mult
c = color.blue
u = plot(upper, color=color.green, title="Upper")
plot(ma, color=#0094FF, title="Basis")
l = plot(lower, color=color.red, title="Lower")
fill(u, l, color=#0094FF, transp=95, title="Background")
crossUpper = crossover(src, upper)
crossLower = crossunder(src, lower)
bprice = 0.0
bprice := crossUpper ? close+syminfo.mintick : nz(bprice[1])
sprice = 0.0
sprice := crossLower ? close-syminfo.mintick : nz(sprice[1])
crossBcond = false
crossBcond := crossUpper ? true
     : na(crossBcond[1]) ? false : crossBcond[1]
crossScond = false
crossScond := crossLower ? true
     : na(crossScond[1]) ? false : crossScond[1]
cancelBcond = crossBcond and (src < ma or high >= bprice )
cancelScond = crossScond and (src > ma or low <= sprice )
if (cancelBcond)
	strategy.cancel("KltChLE")
if (crossUpper)
	strategy.entry("KltChLE", strategy.long, stop=bprice, comment="Long")
if (cancelScond)
	strategy.cancel("KltChSE")
if (crossLower)
	strategy.entry("KltChSE", strategy.short, stop=sprice, comment="Short")

strategy.exit("long exit", "KltChLE", profit = close * tp * 0.01 / syminfo.mintick, loss = close * sl * 0.01 / syminfo.mintick)
strategy.exit("Short exit", "KltChSE", profit = close * tp * 0.01 / syminfo.mintick, loss = close * sl * 0.01 / syminfo.mintick)

plot(bprice, color=color.green)
plot(sprice, color=color.red)