슈퍼 이치 전략

저자:차오장, 날짜: 2023-11-06 16:32:11
태그:

img

전반적인 설명

슈퍼 이치 전략 (Super Ichi strategy) 은 슈퍼 이치 지표에 기초하여 거래 결정을 내리는 트렌드 거래 전략이다. 현재 트렌드 방향을 결정하기 위해 텐칸 라인, 키준 라인 및 슈퍼 이치 지표의 이치모쿠 클라우드 사이의 관계를 사용하여 가격 인하를 입력합니다.

슈퍼 이치 전략은 주로 중장기 트렌드 거래에 적합하며 주요 트렌드로부터 이익을 얻는 것을 목표로합니다. 또한 강력한 트렌드 식별 기능을 가지고 있습니다.

전략 논리

슈퍼 이치 전략은 주로 다음 요소를 판단하여 거래 방향을 결정합니다.

  1. 텐칸과 키준의 관계: 텐칸이 상위에서 상승하고 아래에서 하락

  2. 구름 색상: 구름이 초록색이면 상승, 빨간색이면 하락

  3. 가격 회수: 진입 전에 라인에서 철수를 요구합니다.

특히, 거래 신호는 다음과 같습니다.

긴 신호:

  • 위의 텐칸
  • 텐칸과 키준보다 높은 가격
  • 텐칸과 키준은 구름 위에
  • 가격은 텐칸과 키준 아래로 내려갑니다.

짧은 신호:

  • 아래의 텐칸
  • 텐칸과 키준보다 낮은 가격
  • 텐칸과 키준은 구름 아래
  • 가격은 텐칸과 키준보다 낮아졌다

롱/쇼트 신호가 발사되면 현재 위치에 따라 포지션이 열립니다.

이점 분석

슈퍼 이치 전략은 다음과 같은 장점을 가지고 있습니다:

  1. 트렌드를 정확하게 결정하기 위해 Ichimoku 조합을 사용합니다.

  2. 텐칸/키준은 단기, 클라우드는 장기 추세를 보여줍니다.

  3. 회수 요구 사항은 거짓 파기 피해를 방지합니다

  4. 리스크 관리 (Risk Management) 는 손실을 제한하기 위해 최근 오징어 높은/하락한 스톱 로스를 사용합니다.

  5. 안정적인 이익에 대한 합리적인 위험/이익 비율

  6. 중장기 트렌드 트레이딩의 다른 시간 프레임에 적용

  7. 명확한 논리와 큰 최적화 공간

  8. 다양한 시장 조건에서 좋은 성과

위험 분석

슈퍼 이치 전략은 다음과 같은 위험을 가지고 있습니다.

  1. 스톱 로즈는 다양한 시장에서 자주 발생하여 수익성에 영향을 줄 수 있습니다.

  2. 트렌드가 빠르게 변할 때 빠르게 포지션을 반전하지 않으면 손실이 발생할 수 있습니다.

  3. 부수 위험/이익 비율은 모든 계열에 적합하지 않을 수 있습니다.

  4. 클라우드 브레이크가 제한된 후속을 갖는 경우에 제한된 상승 잠재력

  5. 표시기 매개 변수는 적극적인 도구에 대한 광범위한 테스트와 최적화가 필요합니다.

위험은 다음을 통해 줄일 수 있습니다.

  1. 다양한 시간 프레임 및 도구에 대한 매개 변수 최적화

  2. 시장 범위에서 잘못된 브레이크오웃 엔트리를 피하기 위해 필터를 추가합니다.

  3. 동적 스톱 손실을 사용하여 스톱 아웃을 줄이십시오.

  4. 다른 위험/이익 비율 설정 테스트

  5. 그래프 패턴 등을 사용하여 신호 강도를 확인합니다.

최적화 방향

슈퍼 이치 전략은 다음과 같은 측면에서 최적화 될 수 있습니다:

  1. 거래되는 도구에 더 잘 맞도록 Tenkan/Kijun 매개 변수를 최적화합니다.

  2. 더 나은 장기 트렌드 평가를 위해 클라우드 매개 변수를 최적화

  3. 스톱 로스 알고리즘을 향상 시키고, 예를 들어 ATR 기반 또는 트레일링 스톱

  4. 잘못된 항목을 줄이기 위해 다른 표시기를 사용하여 필터를 추가합니다.

  5. 각기 다른 도구 및 시간 프레임에 대한 리스크/이익 비율을 정밀 조정

  6. 마틴게일 포지션 사이징을 사용하여 변화하는 시장 변동성을 수용합니다.

  7. 매개 변수 최적화 및 안정성을 위해 기계 학습을 활용

  8. 낮 대 밤 세션에 대한 별도의 매개 변수를 설정

요약

슈퍼 이치 전략은 중장기 트렌드 트레이딩에 잘 적합합니다. 이치모쿠를 사용하여 트렌드 방향을 결정하는 데 탁월하며, 풀백 요구 사항은 잘못된 엔트리를 피합니다. 매개 변수 최적화로 더 많은 도구와 시간 프레임에 걸쳐 안정적인 이익을 얻을 수 있습니다. 이해하기 쉽지만 고도로 최적화 할 수있는 슈퍼 이치 전략은 연구 및 학습을위한 훌륭한 기본 트렌드 다음 전략으로 사용됩니다.


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

// Strategy based on the the SuperIchi indicator.
//
// Strategy was designed for the purpose of back testing. 
// See strategy documentation for info on trade entry logic.
// 
// Credits:
//  - SuperIchi [LUX]: LuxAlgo (https://www.tradingview.com/script/vDGd9X9y-SuperIchi-LUX/)

//@version=5
strategy("SuperIchi Strategy", overlay=true, initial_capital=1000, currency=currency.NONE, max_labels_count=500, default_qty_type=strategy.cash, commission_type=strategy.commission.percent, commission_value=0.01)

// =============================================================================
// STRATEGY INPUT SETTINGS
// =============================================================================

// ---------------
// Risk Management
// ---------------
swingLength = input.int(15, "Swing High/Low Lookback Length", group='Strategy: Risk Management', tooltip='Stop Loss is calculated by the swing high or low over the previous X candles')
accountRiskPercent = input.float(2, "Account percent loss per trade", step=0.1, group='Strategy: Risk Management', tooltip='Each trade will risk X% of the account balance')
profitFactor = input.float(2, "Profit Factor (R:R Ratio)", step = 0.1, group='Strategy: Risk Management')
useAtrOverride = input.bool(true, "Use Swing High/Low ATR Override", group='Strategy: Risk Management', tooltip='In some cases price may not have a large enough (if any) swing withing previous X candles. Turn this on to use an ATR value when swing high/low is lower than the given ATR value')
atrMultiplier = input.int(1, "Swing High/Low ATR Override Multiplier", group='Strategy: Risk Management')
atrLength = input.int(14, "Swing High/Low ATR Override Length", group='Strategy: Risk Management')

// -----------------
// Strategy Settings
// -----------------
pullbackLength = input.int(5, "Pullback Lookback Length", group='Strategy: Settings', tooltip='Number of candles to consider for a pullback into the moving averages (prerequisite for trade entry)')

// ----------
// Date Range
// ----------
start_year = input.int(title='Start Date', defval=2022, minval=2010, maxval=3000, group='Strategy: Date Range', inline='1')
start_month = input.int(title='', defval=1, group='Strategy: Date Range', inline='1', options = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])
start_date = input.int(title='', defval=1, group='Strategy: Date Range', inline='1', options = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31])
end_year = input.int(title='End Date', defval=2023, minval=1800, maxval=3000, group='Strategy: Date Range', inline='2')
end_month = input.int(title='', defval=1, group='Strategy: Date Range', inline='2', options = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])
end_date = input.int(title='', defval=1, group='Strategy: Date Range', inline='2', options = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31])
in_date_range = time >= timestamp(syminfo.timezone, start_year, start_month, start_date, 0, 0) and time < timestamp(syminfo.timezone, end_year, end_month, end_date, 0, 0)

// =============================================================================
// INDICATORS
// =============================================================================

// ---------------
// SuperIchi [LUX]
// ---------------
tenkan_len  = input(9,'Tenkan          ',inline='SuperIchi', group='Indicator: SuperIchi Settings')
tenkan_mult = input(2.,'',inline='SuperIchi', group='Indicator: SuperIchi Settings')

kijun_len   = input(26,'Kijun             ',inline='SuperIchi', group='Indicator: SuperIchi Settings')
kijun_mult  = input(4.,'',inline='SuperIchi', group='Indicator: SuperIchi Settings')

spanB_len   = input(52,'Senkou Span B ',inline='SuperIchi', group='Indicator: SuperIchi Settings')
spanB_mult  = input(6.,'',inline='SuperIchi', group='Indicator: SuperIchi Settings')

offset      = input(26,'Displacement', inline='SuperIchi', group='Indicator: SuperIchi Settings')
//------------------------------------------------------------------------------
avg(src,length,mult)=>
    atr = ta.atr(length)*mult
    up = hl2 + atr
    dn = hl2 - atr
    upper = 0.,lower = 0.
    upper := src[1] < upper[1] ? math.min(up,upper[1]) : up
    lower := src[1] > lower[1] ? math.max(dn,lower[1]) : dn
    
    os = 0,max = 0.,min = 0.
    os := src > upper ? 1 : src < lower ? 0 : os[1]
    spt = os == 1 ? lower : upper
    max := ta.cross(src,spt) ? math.max(src,max[1]) : os == 1 ? math.max(src,max[1]) : spt
    min := ta.cross(src,spt) ? math.min(src,min[1]) : os == 0 ? math.min(src,min[1]) : spt
    math.avg(max,min)
//------------------------------------------------------------------------------
tenkan = avg(close,tenkan_len,tenkan_mult)
kijun = avg(close,kijun_len,kijun_mult)

senkouA = math.avg(kijun,tenkan)
senkouB = avg(close,spanB_len,spanB_mult)
//------------------------------------------------------------------------------
tenkan_css = #2157f3 //blue
kijun_css = #ff5d00 //red

cloud_a = color.new(color.teal,80)
cloud_b = color.new(color.red,80)

chikou_css = #7b1fa2

plot(tenkan,'Tenkan-Sen',tenkan_css)
plot(kijun,'Kijun-Sen',kijun_css)

plot(ta.crossover(tenkan,kijun) ? kijun : na,'Crossover',#2157f3,3,plot.style_circles)
plot(ta.crossunder(tenkan,kijun) ? kijun : na,'Crossunder',#ff5d00,3,plot.style_circles)

A = plot(senkouA,'Senkou Span A',na,offset=offset-1)
B = plot(senkouB,'Senkou Span B',na,offset=offset-1)
fill(A,B,senkouA > senkouB ? cloud_a : cloud_b)

plot(close,'Chikou',chikou_css,offset=-offset+1,display=display.none)


// =============================================================================
// STRATEGY LOGIC
// =============================================================================
plotchar(kijun, "kijun", "", location = location.top)
plotchar(senkouA[offset-1], "senkouA", "", location = location.top)


plotchar(tenkan > kijun, "line above", "", location = location.top)
plotchar(close > tenkan, "price above", "", location = location.top)
plotchar(kijun > senkouA[offset-1], "above cloud", "", location = location.top)
// blue line above red line + price above both lines + both lines above cloud
longSen = tenkan > kijun and close > tenkan and kijun > senkouA[offset-1]
// red line below blue line + price below both lines + both lines below cloud
shortSen = tenkan < kijun and close < tenkan and kijun < senkouA[offset-1]

plotchar(longSen, "longSen", "", location = location.top)
plotchar(shortSen, "shortSen", "", location = location.top)

// Cloud is green
longSenkou = senkouA[offset-1] > senkouB[offset-1]
// Cloud is red
shortSenkou = senkouA[offset-1] < senkouB[offset-1]

// price must have pulled back below sen lines before entry
barsSinceLongPullback = ta.barssince(close < kijun and close < tenkan)
longPullback = barsSinceLongPullback <= pullbackLength
// price must have pulled back above sen lines before entry
barsSinceShortPullback = ta.barssince(close > kijun and close > tenkan)
shortPullback = barsSinceShortPullback <= pullbackLength

// plotchar(lowestClose, "lowestClose", "", location = location.top)
// plotchar(highestClose, "highestClose", "", location = location.top)

inLong = strategy.position_size > 0
inShort = strategy.position_size < 0

longCondition = longSen and longSenkou and longPullback and in_date_range
shortCondition = shortSen and shortSenkou and shortPullback and in_date_range

swingLow = ta.lowest(source=low, length=swingLength)
swingHigh = ta.highest(source=high, length=swingLength)

atr = useAtrOverride ? ta.atr(atrLength) * atrMultiplier : 0
longSl = math.min(close - atr, swingLow)
shortSl = math.max(close + atr, swingHigh)

longStopPercent = math.abs((1 - (longSl / close)) * 100)
shortStopPercent = math.abs((1 - (shortSl / close)) * 100)

longTpPercent = longStopPercent * profitFactor
shortTpPercent = shortStopPercent * profitFactor
longTp = close + (close * (longTpPercent / 100))
shortTp = close - (close * (shortTpPercent / 100))

// Position sizing (default risk 2% per trade)
riskAmt = strategy.equity * accountRiskPercent / 100
longQty = math.abs(riskAmt / longStopPercent * 100) / close
shortQty = math.abs(riskAmt / shortStopPercent * 100) / close

if (longCondition and not inLong)
    strategy.entry("Long", strategy.long, qty=longQty)
    strategy.exit("Long  SL/TP", from_entry="Long", stop=longSl, limit=longTp, alert_message='Long SL Hit')
    buyLabel = label.new(x=bar_index, y=high[1], color=color.green, style=label.style_label_up)
    label.set_y(id=buyLabel, y=low)
    label.set_tooltip(id=buyLabel, tooltip="Risk Amt: " + str.tostring(riskAmt) + "\nQty: " + str.tostring(longQty) + "\nSwing low: " + str.tostring(swingLow) + "\nStop Percent: " + str.tostring(longStopPercent) + "\nTP Percent: " + str.tostring(longTpPercent))

if (shortCondition and not inShort)
    strategy.entry("Short", strategy.short, qty=shortQty)
    strategy.exit("Short  SL/TP", from_entry="Short", stop=shortSl, limit=shortTp, alert_message='Short SL Hit')
    sellLabel = label.new(x=bar_index, y=high[1], color=color.red, style=label.style_label_up)
    label.set_y(id=sellLabel, y=low)
    label.set_tooltip(id=sellLabel, tooltip="Risk Amt: " + str.tostring(riskAmt) + "\nQty: " + str.tostring(shortQty) + "\nSwing high: " + str.tostring(swingHigh) + "\nStop Percent: " + str.tostring(shortStopPercent) + "\nTP Percent: " + str.tostring(shortTpPercent))


더 많은