이동평균 전략에 기초한 통합 이치모쿠 켈트너 거래 시스템

저자:차오장, 날짜: 2023-12-20 13:40:08
태그:

img

전반적인 설명

이 전략은 이동 평균 전략, 이치모쿠 클라우드 차트 및 켈트너 채널 기술 지표를 통합하여 트렌드 추적 및 돌파구 거래를 달성하여 고주파 알고리즘 거래에 적합합니다.

전략 원칙

  1. Keltner 채널을 사용하여 주가가 채널의 상부 및 하부 레일을 초과하는지 판단하여 포지션을 개설하는 신호로 사용하십시오.
  2. 이치모쿠 클라우드 차트는 트렌드 방향을 판단하고 켈트너 채널을 사용합니다.
  3. 이동 평균 전략은 종료 신호를 보내

이점 분석

  1. 결정 정확성을 향상시키기 위해 포괄적 인 판단을 위해 여러 가지 기술 지표를 통합하십시오.
  2. 켈트너 채널은 포지션을 개설할 때 최고치를 추격하고 최저치를 제거하는 것을 피하기 위해 과소매와 과소매 조건을 판단합니다.
  3. 이치모쿠 클라우드 차트는 트렌드에 반하는 거래를 피하기 위해 주요 트렌드를 판단합니다.
  4. 이동 평균 전략은 충격을 필터링하고 과도한 민감성을 방지합니다.

위험 분석

  1. 여러 지표의 통합은 매개 변수 설정을 더 복잡하게 만들고 신중한 테스트를 요구합니다.
  2. 회전선과 클라우드 차트의 기본선의 교차는 항상 신뢰할 수 있는 거래 신호가 아닙니다.
  3. 켈트너 채널은 다른 조류의 특성에 적응하기 위해 매개 변수를 조정해야합니다.

최적화 방향

  1. 서버 성능을 평가하고 거래 빈도를 높이기 위해 이동 평균 주기를 적절히 단축합니다.
  2. 매개 변수에 대한 다른 주류의 감수성을 테스트하고 적응 매개 변수를 설정합니다.
  3. 단일 손실을 줄이기 위해 스톱 로스 전략을 강화

요약

이 전략은 트렌드 추적 및 효율적인 돌파 트레이딩을 달성하기 위해 이치모쿠 클라우드 차트, 켈트너 채널 및 이동 평균 전략을 여러 기술적 지표와 통합합니다. 단일 지표와 비교하면이 전략의 판단은 특정 잘못된 신호를 피하여 더 포괄적이고 정확합니다. 동시에 매개 변수 설정이 더 복잡하고 개별 주식에 최적화되어야한다는 문제도 있습니다. 일반적으로이 전략은 중요한 영향을 미치는 고주파 알고리즘 거래에 적합합니다.


/*backtest
start: 2023-11-19 00:00:00
end: 2023-12-19 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
// Author: Persio Flexa
// Description: Ichimoku Clouds with Keltner Channel, perfect for margin trading 
strategy("Ichimoku Keltner Strategy", overlay=true) 

// -- Keltner ------------------------------------------------------------------
source = close

useTrueRange = input(true)
length = input(18, minval=1) 
mult = input(1.8)

ma = sma(source, length)
range = useTrueRange ? tr : high - low
rangema = sma(range, length)
upper = ma + rangema * mult
lower = ma - rangema * mult

plot(ma, title="BASE", color=orange,transp=85)
plot(upper, title="UPPER", color=red)
plot(lower, title="LOWER", color=green)

//crossUpper = crossover(source, upper)
//crossLower = crossunder(source, lower)
crossUpper = source > upper
crossLower = source  < lower

bprice = 0.0
bprice := crossUpper ? high+syminfo.mintick : nz(bprice[1])

sprice = 0.0
sprice := crossLower ? low -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 (source < ma or high >= bprice )
cancelScond = crossScond and (source > ma or low <= sprice )

// ---------------------------------------------------------------------


// -- Ichimoku

ATRlength = input(200, minval=1)
ATRMult = input(2.272, minval=1)

ATR = rma(tr(true), ATRlength)

len = input(26, minval=1, title="EMA Length")
src = input(close, title="Source")
out = ema(src, len)

emaup = out+(ATR*ATRMult)
emadw = out-(ATR*ATRMult)

conversionPeriods = input(15, minval=1),
basePeriods = input(35, minval=1)
laggingSpan2Periods = input(52, minval=1),
displacement = input(26, minval=1)

donchian(len) => avg(lowest(len), highest(len))

conversionLine = donchian(conversionPeriods)
baseLine = donchian(basePeriods)
leadLine1 = avg(conversionLine, baseLine)
leadLine2 = donchian(laggingSpan2Periods)

p1 = plot(leadLine1, offset = displacement, color=green,transp=85, title="Lead 1")
p2 = plot(leadLine2, offset = displacement, color=red,transp=85, title="Lead 2")
fill(p1, p2,silver) 

longCond    = crossover(conversionLine, baseLine)
shortCond   = crossunder(conversionLine, baseLine)
// -------------------------------------------------------------------------

if (crossUpper and (conversionLine > baseLine))
    strategy.entry("long", strategy.long, stop=bprice, comment="LONG")

if (crossLower and (conversionLine < baseLine))
    strategy.entry("short", strategy.short, stop=sprice, comment="SHORT")
    
strategy.close("long", when = (shortCond and source < lower))
strategy.close("short", when = (longCond and source > upper))

더 많은