이치모쿠 클라우드 퀀트 전략

저자:차오장, 날짜: 2023-11-24 10:15:15
태그:

img

전반적인 설명

이 전략은 이치모쿠 클라우드 양자 전략입니다. 이 전략은 트렌드가 상승할 때 신호를 필터하고 더 나은 입구 지점에서 긴 거리를 가리기 위해 K-라인 패턴, 이동 평균 및 스토카스틱 RSI 지표와 결합하여 이치모쿠 지표를 통해 트렌드 방향을 판단합니다.

전략 원칙

전략의 주요 판단 기준은 다음과 같습니다.

  1. 이치모쿠 리드 라인 1이 리드 라인 2 위에 넘어가고 상승 추세를 나타냅니다.
  2. K 라인 닫기 가격은 리드 라인 1보다 높고, 트렌드를 따라가는 조건을 충족합니다.
  3. K 라인은 녹색 촛불이고, 트렌드는 상승합니다.
  4. 이동평균이 활성화되면 빠른 MA는 느린 MA를 넘습니다.
  5. 스토카스틱 RSI가 활성화되면 %K 라인이 %D 라인의 위를 넘습니다.

위의 모든 조건이 동시에 충족되면 전략은 긴 포지션을 열고 가격이 리드 라인 1 이하로 떨어지면 전략은 포지션을 닫습니다.

이 전략은 주로 이치모쿠 클라우드를 사용하여 주요 트렌드 방향을 결정하고 보조 지표와 결합하여 신호를 필터하고 트렌드가 상승할 때 더 나은 지점에서 긴 지점을 사용합니다.

전략 의 장점

  1. 이치모쿠 클라우드를 사용하여 주요 트렌드를 결정합니다. 백테스트는 높은 정확도를 보여줍니다.
  2. 여러 보조 지표와 결합하여 입구 지점을 필터링하면 수익률을 크게 향상시킬 수 있습니다.
  3. 롱 (long) 전략, 황소 시장에 있는 것으로 판단되는 통화에 적합하다
  4. 매개 변수 최적화를 위한 큰 공간, 추가 최적화를 위해 지표 매개 변수를 조정할 수 있습니다

전략 의 위험

  1. 이치모쿠 구름이 추세를 잘못 판단할 가능성이 있습니다.
  2. 급격한 시장 변화로 인해 손해가 증가할 때 스톱 로스 포인트가 깨질 수 있습니다.
  3. 황소 시장에 설계되어 있으며, 트렌드 반전의 숨겨진 징후가있는 통화에는 적합하지 않습니다.
  4. 부적절한 매개 변수 설정은 지나치게 공격적인 입력 또는 지나치게 보수적인 동작으로 이어질 수 있습니다.

대책:

  1. 추세를 판단하기 위해 더 많은 지표를 결합하고 정확도를 향상시킵니다.
  2. 단일 손실을 엄격하게 제어하기 위해 합리적인 스톱 손실 지점을 설정
  3. 다른 화폐의 시장 조건에 따라 적절한 전략을 선택
  4. 전략의 안정성을 높이기 위해 매개 변수를 신중하게 테스트하고 최적화하십시오.

전략 최적화의 방향

  1. 안정성을 더 향상시키기 위해 보조 지표의 매개 변수 설정을 최적화하십시오.
  2. 트레일링 스톱 로스, 기하급수적인 이동 평균 스톱 로스 등 스톱 로스 메커니즘을 추가합니다.
  3. 고정된 위치 사이즈, 위치 평균 등과 같은 위치 관리를 추가합니다.
  4. 특정 화폐에 대한 매개 변수 조정 및 최적화

요약

이치모쿠 클라우드 퀀트 전략은 트렌드 방향을 판단함으로써 높은 승률을 달성하면서도 위험을 제어 할 수있는 단장 전략입니다. 전략의 장점은 분명하며 황소 시장에서 뛰어난 성능을 보여줍니다. 다음 단계는 지표 최적화, 스톱 로스 메커니즘, 포지션 관리와 같은 측면을 개선하여 전략을 보다 포괄적이고 안정적으로 만드는 것입니다.


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

//@version=4

strategy(title="Ichimoku only Long Strategy", shorttitle="Ichimoku only Long", overlay = true, pyramiding = 0, calc_on_order_fills = false, commission_type =  strategy.commission.percent, commission_value = 0, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, initial_capital=10000, currency=currency.USD)

// Time Range
FromMonth=input(defval=1,title="FromMonth",minval=1,maxval=12)
FromDay=input(defval=1,title="FromDay",minval=1,maxval=31)
FromYear=input(defval=2017,title="FromYear",minval=2017)
ToMonth=input(defval=1,title="ToMonth",minval=1,maxval=12)
ToDay=input(defval=1,title="ToDay",minval=1,maxval=31)
ToYear=input(defval=9999,title="ToYear",minval=2017)
start=timestamp(FromYear,FromMonth,FromDay,00,00)
finish=timestamp(ToYear,ToMonth,ToDay,23,59)
window()=>true
// See if this bar's time happened on/after start date
afterStartDate = time >= start and time<=finish?true:false

//Enable RSI
enableema = input(true, title="Enable EMA?")
enablestochrsi = input(false, title="Enable Stochastik RSI?")

//EMA
emasrc = close, 
len1 = input(24, minval=1, title="EMA 1")
len2 = input(90, minval=1, title="EMA 2")

ema1 = ema(emasrc, len1)
ema2 = ema(emasrc, len2)

col1 = color.lime
col2 = color.red

//EMA Plots
plot(ema1, title="EMA 1", linewidth=1, color=col1)
plot(ema2, title="EMA 2", linewidth=1, color=col2)

//STOCH RSI
smoothK = input(3, minval=1, title="RSI K Line")
smoothD = input(3, minval=1, title="RSI D Line")
lengthRSI = input(14, minval=1, title="RSI Length")
lengthStoch = input(14, minval=1, title="Stochastik Length")
src = input(close, title="RSI Source")

rsi1 = rsi(src, lengthRSI)
k = sma(stoch(rsi1, rsi1, rsi1, lengthStoch), smoothK)
d = sma(k, smoothD)

//Ichimoku
conversionPeriods = input(9, minval=1, title="Ichi Conversion Line Length")
basePeriods = input(26, minval=1, title="Ichi Base Line Length")
laggingSpan2Periods = input(52, minval=1, title="Ichi Lagging Span 2 Length")
displacement = input(1, minval=0, title="Ichi Displacement")
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 - 1, color=color.green,
	 title="Lead 1")
p2 = plot(leadLine2, offset = displacement - 1, color=color.red,
	 title="Lead 2")
fill(p1, p2, color = leadLine1 > leadLine2 ? color.green : color.red)


//Long Condition
crossup = k[0] > d[0] and k[1] <= d[1]
ichigreenabovered = leadLine1 > leadLine2
ichimokulong = close > leadLine1
greencandle =  close > open
redcandle = close < open
emacond = ema1 > ema2
longcondition = ichigreenabovered and ichimokulong and greencandle

//Exit Condition
ichimokuexit = close < leadLine1

exitcondition = ichimokuexit and redcandle

//Entrys

if (enablestochrsi == false) and (enableema == false) and (longcondition) and (afterStartDate) and (strategy.opentrades < 1)
    strategy.entry("Long", strategy.long)
    
if (enablestochrsi == true) and (enableema == false) and (longcondition) and (crossup) and (afterStartDate) and (strategy.opentrades < 1)
    strategy.entry("Long", strategy.long)

if (enableema == true) and (enablestochrsi == false) and (longcondition) and (emacond) and (afterStartDate) and (strategy.opentrades < 1)
    strategy.entry("Long", strategy.long)

if (enableema == true) and (enablestochrsi == true) and (longcondition) and (emacond) and (crossup) and (afterStartDate) and (strategy.opentrades < 1)
    strategy.entry("Long", strategy.long)


//Exits
if (afterStartDate)
    strategy.close(id = "Long", when = exitcondition)









더 많은