이치모쿠 트렌드 전략

저자:차오장, 날짜: 2023-12-11 15:00:29
태그:

img

전반적인 설명

이 전략은 트렌드 추적 및 평형 브레이크업 거래를 위한 이치모쿠 지표에 기초하여 설계되었으며, 중장기 가격 동향을 파악하여 안정적인 수익을 창출하는 것을 목표로 합니다.

전략 논리

이 전략은 이치모쿠의 다섯 라인 - 텐칸센, 키준센, 센코 스판 A, 센코 스판 B 및 치코 스판을 사용하여 가격 추세와 지원/저항 수준을 결정합니다. 구체적인 입시 규칙은 다음과 같습니다.

  1. 키준센과 키준센의 접점이 평평하지 않을 때 구매 신호가 발사됩니다.
  2. 키준센과 키준센의 교차선이 평평하지 않을 때 판매 신호가 발사됩니다.
  3. 클로즈가 클라우드 위에 있을 때 유동성은 포지션 취득에 좋습니다.
  4. 클로즈가 클라우드 이하인 경우 유동성이 낮아서 포지션을 취하는 것은 피해야 합니다.
  5. 치코 스판이 닫을 때 구매 신호가 발사됩니다.
  6. 치코 스판이 닫기 전에 지나면 판매 신호가 발사됩니다.

위의 거래 신호는 최종 입시 시기를 결정하기 위해 결합됩니다.

이점 분석

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

  1. 트렌드를 결정하기 위해 이치모쿠를 사용하면 시장 소음을 필터링하고 중장기 트렌드를 파악할 수 있습니다.
  2. 클라우드 조건을 포함하면 유동성이 떨어지는 포지션을 취하는 것을 피합니다.
  3. 치코 스판은 거짓 탈출을 피하기 위해 확인 역할을 합니다.
  4. 이 규칙은 간단하고 실행에 명확합니다.

위험 분석

이 전략의 위험은 다음과 같습니다.

  1. 부적절한 매개 변수 설정은 거래 기회를 놓칠 수 있습니다.
  2. 트렌드가 변하면 트렌드 판단이 늦어지기도 하고, 시간적으로 손실을 줄일 수 없게 되기도 합니다.
  3. 긴 포지션의 손실 위험이 높습니다.

이러한 위험은 매개 변수를 최적화하고 다른 지표와 결합하여 트렌드 변화를 결정하고 엄격한 스톱 로스를 통해 해결 할 수 있습니다.

최적화 방향

이 전략은 다음 측면에서 더 이상 최적화 될 수 있습니다.

  1. 최고의 조합을 찾기 위해 이치모쿠 매개 변수를 최적화해
  2. 트렌드 오차를 피하기 위해 가격 & 볼륨 필터를 추가합니다.
  3. 변동성 지표를 포함하여 전환점을 식별합니다.
  4. 트렌드 상태를 결정하기 위해 머신러닝 모델을 추가합니다.

요약

이 전략은 이치모쿠를 활용하여 가격 트렌드와 유동성 조건을 결정하여 트렌드를 추적하여 효과적으로 잡음을 필터링하고 중장기 트렌드를 포착할 수 있습니다. 매개 변수 조정, 보조 필터 추가 및 트렌드 역전 신호를 식별하는 추가 최적화는 전략의 수익 인자를 향상시킬 수 있습니다.


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

//@version=3
strategy("My Ichimoku Strat", overlay=true,default_qty_type=strategy.percent_of_equity, default_qty_value=100, initial_capital=1000, currency=currency.EUR)
// === BACKTEST RANGE ===
FromMonth = input(defval = 1, title = "From Month", minval = 1)
FromDay   = input(defval = 1, title = "From Day", minval = 1)
FromYear  = input(defval = 2017, title = "From Year", minval = 2014)
ToMonth   = input(defval = 1, title = "To Month", minval = 1)
ToDay     = input(defval = 1, title = "To Day", minval = 1)
ToYear    = input(defval = 9999, title = "To Year", minval = 2014)

// === SERIES SETUP ===
//**** Inputs *******
KijunSenLag = input(6,title="KijunSen Lag",minval=1)

//Kijun-sen
//Support resistance line, buy signal when price crosses it
KijunSen = sma((high+low)/2,26)
buy2 = crossover(close,KijunSen) and (rising(KijunSen,KijunSenLag) or falling(KijunSen,KijunSenLag))
sell2= crossunder(close,KijunSen) and (rising(KijunSen,KijunSenLag) or falling(KijunSen,KijunSenLag))


//Tenkan-Sen
TenkanSen = sma((high+low)/2,9)

//Senkou Span A 
SenkouSpanA = (KijunSen + TenkanSen)/2

//Senkou Span B 
SenkouSpanB = sma((high+low)/2,52)

//Cloud conditions : ignore buy if price is under the cloud
// Huge cloud means safe support and resistance. Little cloud means danger.
buy3 = close > SenkouSpanA and close > SenkouSpanB
sell3 = close < SenkouSpanA and close < SenkouSpanB


//Chikou Span
//Buy signal : crossover(ChikouSpan,close)
//Sell Signal : crossunder(ChikouSpan,close)
ChikouSpan = close
buy1=crossover(ChikouSpan,close[26])
sell1=crossunder(ChikouSpan,close[26])

plotshape(buy1,style=shape.diamond,color=lime,size=size.small)
plotshape(sell1,style=shape.diamond,color=orange,size=size.small)

//Alerts

buyCompteur = -1
buyCompteur := nz(buyCompteur[1],-1)
buyCompteur := buy2 or buy3 ? 1 : buyCompteur
buyCompteur := buyCompteur > 0 ? buyCompteur + 1 : buyCompteur
buyCompteur := sell2 or sell3 ? -1 : buyCompteur

sellCompteur = -1
sellCompteur := nz(sellCompteur[1],-1)
sellCompteur := sell2 or sell3 ? 1 : sellCompteur
sellCompteur := sellCompteur > 0 ? sellCompteur + 1 : sellCompteur
sellCompteur := buy2 or buy3 ? -1 : sellCompteur

sell= sell2 and sell3 or (sell1 and buyCompteur <= 8)
buy=buy2 and buy3 or (buy1 and sellCompteur <=8)
plotchar(buy,char='B',size=size.small,color=lime)
plotchar(sell,char='S',size=size.small,color=orange)

//plots
plot(KijunSen,title="Kijun-Sen",color=blue,linewidth=4)
plot(TenkanSen,title="Tenkan-Sen",color=red,linewidth=2)
cloudA = plot(SenkouSpanA,title="cloud A", color=lime,offset=26,linewidth=2)
cloudB = plot(SenkouSpanB,title="cloud B", color=orange,offset=26,linewidth=2)
plot(ChikouSpan,title="lag span",color=fuchsia, linewidth=2,offset=-26)
//plot()
fill(cloudA,cloudB,color=SenkouSpanA>SenkouSpanB?lime:orange)
//plot(close,color=silver,linewidth=4)

// === ALERTS ===
strategy.entry("L", strategy.long, when=(buy and (time > timestamp(FromYear, FromMonth, FromDay, 00, 00)) and (time < timestamp(ToYear, ToMonth, ToDay, 23, 59))))
strategy.close("L", when=(sell and (time < timestamp(ToYear, ToMonth, ToDay, 23, 59))))

더 많은