이치모쿠 돈 관리와 함께 단기 장기 전략

저자:차오장, 날짜: 2023-12-28 12:12:51
태그:

img

전반적인 설명

이 전략은 이치모쿠 거래 시스템을 기반으로 한 개선입니다. 주요 아이디어는 이치모쿠 지표와 돈 관리 규칙을 결합하여 단기 및 긴 거래 기회를 식별하는 것입니다.

전략 원칙

이 전략은 고전적인 이치모쿠 시스템을 기본 참조로 사용합니다. 주요 구성 요소는 다음과 같습니다.

텐칸센: 전환선 중장기 동향을 반영합니다.

키준센: 기본 라인입니다. 장기적인 추세를 반영합니다.

센쿠 스판: 선도 라인. 미래 트렌드를 반영.

치쿠스판: 뒤떨어진 선. 과거의 경향을 반영합니다.

이 기반에서 전략은 다음과 같은 개선 사항을 수행했습니다.

  1. 시간 매개 변수들은 시장 패턴에 더 잘 맞도록 홀수 제곱 이론을 따르고 있습니다.

  2. 금전 관리 규칙은 거래 위험을 통제하기 위해 스톱 로스, 영업 수익, 포지션 사이즈 등을 포함합니다.

  3. 더 포괄적인 테스트를 위해 배크테스팅 기간을 조정할 수 있습니다.

구체적으로, 긴 진입 조건은 텐칸 크로스 키 위, 치코우 가격 위, 가격 위, 미래의 큐모 상승 등이 포함됩니다. 짧은 진입은 텐칸 크로스 키 아래, 치코우 가격 아래 등을 요구합니다.

화폐 관리 규칙은 장기간에 대해 30%의 수익을 취하고 5%의 스톱 로스를 요구합니다. 단편에 대해 3 ATR 이상의 경우 스톱 로스를 요구합니다.

이점 분석

이치모쿠와 돈 관리의 주요 장점은 다음과 같습니다.

  1. 이치모쿠 자체는 단기, 중장기, 합리적인 진입/출출을 반영합니다.

  2. 홀수 제곱 이론은 시장 통계와 일치하도록 매개 변수를 최적화합니다.

  3. 금전관리는 수익이 증가하는 동안 단일 거래 스톱 손실을 효과적으로 제어합니다.

  4. 조정 가능한 백테스팅 기간은 보다 포괄적인 테스트를 가능하게 합니다.

요약하자면, 이 전략은 트렌드, 매개 변수 선택, 위험 통제 등을 포괄적으로 고려하고 있으며, 단기 장기 기회를 식별하고 거래 위험을 통제하는 데 효과적이며, 강력한 실용성을 가지고 있습니다.

위험 분석

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

  1. 이치모쿠는 가짜 유출을 일으켜 불필요한 입력을 일으킨다

  2. 고정 수익 취득 및 중지 손실은 함정에 취약할 수 있습니다. 동적 규칙이 필요합니다.

  3. 불완전한 백테스팅 데이터는 성능을 과대평가 할 수 있습니다. 더 많은 시장에서 더 긴 테스트가 필요합니다.

  4. 이 전략은 트렌드 시장에 더 적합합니다. 범위 시장에서 성과가 떨어질 수 있습니다. 트렌드 식별을 위해 진입 조건을 최적화 할 수 있습니다.

개선 방향

주요 개선 분야는 다음과 같습니다.

  1. 입력 품질을 향상시키기 위해 MACD, KDJ 등 지표 필터를 추가합니다.

  2. 동적 이윤 취득 및 스톱 손실. 예를 들어, N ATR 브레이크 이후의 이윤 취득, 지원 아래의 스톱 손실.

  3. 안정성 검증을 위해 더 긴 데이터에 대한 다중 자산 테스트

  4. 트렌딩과 시장의 범위를 구별합니다. 변화하는 시장 조건에 적응하기 위해 항목을 최적화하십시오.

결론

이 전략은 트렌드, 화폐 관리 등을 포괄적으로 고려하고, 이치모쿠를 사용하여 장기 기회를 식별하고, 단일 거래 손실을 제한하기 위해 위험 통제 규칙을 적용합니다. 원래 이치모쿠 시스템보다 상당한 개선. 추가 최적화는 잠재적으로 매우 실용적인 단기 전략으로 만들 수 있습니다. 이치모쿠는 이치모쿠를 활용하여 장기적인 기회를 파악하고, 장기적인 수익을 창출합니다.


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

// Author Obarut
//@version=5
strategy("İchimoku Strategy With MM Short-Long",overlay=true,process_orders_on_close=true)

//Ichimoku Inputs
ts_period = input.int(8, minval=1, title="Tenkan-Sen Period")
ks_period = input.int(16, minval=1, title="Kijun-Sen Period")
ssb_period = input.int(24, minval=1, title="Senkou-Span B Period")
cs_offset = input.int(16, minval=1, title="Chikou-Span Offset")
ss_offset = input.int(8, minval=1, title="Senkou-Span Offset")
long_entry = input(true, title="Long Entry")
short_entry = input(true, title="Short Entry")

// Back Testing Period Inputs

fromday = input.int(defval=1,title="Start Date",minval=1,maxval=31) 
frommonth = input.int(defval=1,title="Start Month",minval=1,maxval=12)
fromyear = input.int(defval=1980,title="Start Year",minval=1800, maxval=2100)
today = input.int(defval=1,title="En Date",minval=1,maxval=31)
tomonth = input.int(defval=1,title="End Month",minval=1,maxval=12)
toyear =input.int(defval=2100,title="End Year",minval=1800,maxval=2200)
start=timestamp(fromyear,frommonth,fromday,00,00)
finish=timestamp(toyear,tomonth,today,00,00)
timewindow= time>=start and time<=finish

//Ichimoku Componenets Calculation Function
middle(len) => math.avg(ta.lowest(len), ta.highest(len))

// Ichimoku Components

tenkan = middle(ts_period)
kijun = middle(ks_period)
senkouA = math.avg(tenkan, kijun)
senkouB = middle(ssb_period)
//Senkou Span Lines slopes
slopetenkan=(tenkan-tenkan[2])/tenkan
slopekijun= (kijun-kijun[2])/kijun
//Avarage True Range 
atr = ta.atr(14)
//Senkou Span Lines
ss_above = math.max(senkouA[ss_offset-1], senkouB[ss_offset-1])
ss_below = math.min(senkouA[ss_offset-1], senkouB[ss_offset-1])

// Price Distance From Tenkan
distance = close - tenkan

// Price Distance from Kijun
distancek = close - kijun

// Entry/Exit Signals

tk_cross_kijun_bull = tenkan >= kijun//Tenkan Sen is greater than or equal to  Kijun Sen
tk_cross_kijun_bear = tenkan <= kijun//Tenkan Sen is smaller than or equal to Kijun Sen
cs_cross_bull = close > high[cs_offset-1]//Chikou is above the price
cs_cross_bear = close < close[cs_offset-1]//Chikou is below the price
price_above_kumo = close > ss_above//Price is above the Kumo cloud
pbsenkA = close < ss_above // Price is below the Senkou Span which is higher
pasenkB = close > ss_below// Price is above the Senkou span which is lower
price_below_kumo = close < ss_below // Price is below Kumo cloud
future_kumo_bull = senkouA > senkouB and (ta.roc(senkouA,3)>0) and (ta.roc(senkouB,3)>=0) // Future Kumo cloud is bullish
pbtenkan=close<tenkan
tkbelowkij=tenkan<kijun
future_kumo_bear = senkouA < senkouB//Future Kumo cloud is bearish
// Price Distance From Tenken
disbull = distance < 2*atr
//Price Distance From Kijun
disbullk = distancek < 3*atr
//Price Above Tenkan Condition
patk = close > tenkan
// Kijun Above Senkou Span Condition
kjasenkA = kijun > ss_above
// Price Below Kijun Condition
pbkijun = close < kijun
//Consolidation Tenkan and Kijun are inside Kumo cloud
kijuninsidekumo= kijun<ss_above and kijun>ss_below
tenkaninsidekumo= tenkan<ss_above and tenkan>ss_below
consolidation=kijuninsidekumo and tenkaninsidekumo

//Bullish Entry Condition

bullish= tk_cross_kijun_bull and cs_cross_bull and price_above_kumo and future_kumo_bull and disbull and patk 
     and not consolidation
//Bullish exit
bearish=tk_cross_kijun_bear and pbsenkA and cs_cross_bear  and future_kumo_bear
      or price_below_kumo     
// Bearish Entry Condition

bearish2=tk_cross_kijun_bear and pbtenkan and tkbelowkij and tkbelowkij and cs_cross_bear and future_kumo_bear

if(bullish and timewindow and long_entry )
    strategy.entry("Long Entry", strategy.long)


if(bearish2 and timewindow and short_entry)
    strategy.entry("Short Entry",strategy.short)
// Bearish Condition



lastentryprice = strategy.opentrades.entry_price(strategy.opentrades - 1)

// Take Profit or Stop Loss in Bearish

exit1= (close-tenkan)>3*atr and slopetenkan<=0
exit2= (close-lastentryprice)>5*atr and close<(tenkan-0.04*atr)

if(bearish and timewindow and not short_entry or exit1 or exit2  or (close>1.30*lastentryprice  ) or (close< 0.95*lastentryprice))
    strategy.close("Long Entry")
if(bullish and timewindow and not long_entry)
    strategy.close("Short Entry")
if(time>finish)
    strategy.close_all("time up")

plot(tenkan, color=#0496ff, title="Tenkan-Sen")
plot(kijun, color=#991515, title="Kijun-Sen")
plot(close, offset=-cs_offset+1, color=#2e640e, title="Chikou-Span")
sa=plot(senkouA, offset=ss_offset-1, color=color.rgb(17, 122, 21), title="Senkou-Span A")
sb=plot(senkouB, offset=ss_offset-1, color=color.rgb(88, 8, 8), title="Senkou-Span B")
fill(sa, sb, color = senkouA > senkouB ? color.rgb(198, 234, 198) : color.rgb(208, 153, 153), title="Cloud color")

더 많은