이치모쿠 클라우드와 볼링거 밴드 조합 거래 전략

저자:차오장, 날짜: 2023-12-27 16:21:28
태그:

img

전반적인 설명

이 전략은 일본의 이치모쿠 클라우드 지표와 볼링거 밴드 지표를 결합하여 장기 및 단위 포지션에 대한 거래 신호를 생성합니다. 이 전략은 잘못된 거래를 피하기 위해 볼링거 밴드 지표가 장기 및 단위 신호를 발행 할 때 시장 트렌드를 효과적으로 결정하고 판단 할 수 있습니다.

전략 원칙

  1. 이치모쿠 클라우드는 전환선, 기본선, 후진선, 선도선으로 구성된다. 전환선은 9일 이동평균이고 기본선은 26일 이동평균이다. 전환선이 기본선 위에 있을 때 상승 신호이며, 반대로 하락 신호이다.

  2. 뒤떨어진 선은 가격의 뒤떨어진 움직임이다. 뒤떨어진 선이 위에 있을 때 상승 추세를 나타낸다. 아래는 하락 추세를 나타낸다.

  3. 클라우드 밴드는 52일 이동 평균과 26일 이동 평균의 평균인 두 개의 선으로 구성됩니다. 클라우드 밴드 위의 가격은 상승세를 보이며 아래는 하락세를 보입니다.

  4. 볼링거 밴드는 n일 이동 평균과 표준편차로 구성되어 있으며, 가격의 변동성 밴드를 나타냅니다. 상단단위 이상의 파업은 황소들이 통제하고 있으며 하단단위 이하의 파업은 곰들이 통제하고 있음을 나타냅니다.

  5. 이 전략은 이치모쿠 클라우드에서 생성된 신호와 볼링거 밴드의 브레이크아웃을 기반으로 거래 규칙을 형성합니다. 예를 들어, 변환 선이 기본 선 위에 상승적 크로스오버를 가지고 있고, 뒤떨어진 선이 위에 있으면, 가격이 클라우드 밴드를 통과하고, 볼링거 밴드의 상위 밴드를 통과하면 긴 엔트리 신호를 유발합니다.

전략 의 장점

  1. 이치모쿠 클라우드는 트렌드 방향을 명확히 판단하며, 전환 및 후진선은 단기 트렌드를 나타내고 클라우드 대역은 중장기 트렌드 방향을 나타냅니다.

  2. 볼링거 대역은 가격이 지나치게 늘어났는지 여부를 결정합니다. 이것은 불필요한 거래를 효과적으로 필터링할 수 있습니다.

  3. 지표의 조합은 거래 신호를 더 명확하고 신뢰성있게 만들어 거래 위험을 피합니다.

위험 과 최적화

  1. 부적절한 Bollinger Bands 매개 변수 설정은 부정확한 거래 신호로 이어질 수 있습니다. 매개 변수는 각기 다른 기본 자산에 따라 신중하게 설정되어야 합니다.

  2. 포지션 크기는 위험을 조절하기 위해 적절하게 조정되어야 합니다. 너무 큰 포지션은 더 큰 손실로 이어질 수 있습니다.

  3. 가격들이 불리한 방향으로 특정 범위를 넘어서면 손실을 막기 위해 스톱 로스 전략을 적용하는 것을 고려하십시오.

  4. 이치모쿠 클라우드와 결합한 더 많은 지표를 테스트하여 더 신뢰할 수있는 거래 전략을 형성하는 것을 고려하십시오.

결론

이 전략은 트렌드 방향을 결정하기 위해 이치모쿠 클라우드와 신호를 필터하기 위해 볼링거 밴드 지표를 효과적으로 활용한다. 전략 신호는 비교적 명확하고 신뢰할 수 있다. 매개 변수 조정과 스톱 로스 최적화를 통해 거래 위험을 줄이고 좋은 수익을 얻을 수 있다.


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

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Coinrule

//@version=5
strategy("Ichimoku Cloud and Bollinger Bands",
         overlay=true,
         initial_capital=1000,
         process_orders_on_close=true,
         default_qty_type=strategy.percent_of_equity,
         default_qty_value=30,
         commission_type=strategy.commission.percent,
         commission_value=0.1)

showDate = input(defval=true, title='Show Date Range')
timePeriod = true
notInTrade = strategy.position_size <= 0


//Ichimoku Cloud
//Inputs
ts_bars = input.int(9, minval=1, title="Tenkan-Sen Bars")
ks_bars = input.int(26, minval=1, title="Kijun-Sen Bars")
ssb_bars = input.int(52, minval=1, title="Senkou-Span B Bars")
cs_offset = input.int(26, minval=1, title="Chikou-Span Offset")
ss_offset = input.int(26, minval=1, title="Senkou-Span Offset")
long_entry = input(true, title="Long Entry")
short_entry = input(true, title="Short Entry")

middle(len) => math.avg(ta.lowest(len), ta.highest(len))

// Components of Ichimoku Cloud
tenkan = middle(ts_bars)
kijun = middle(ks_bars)
senkouA = math.avg(tenkan, kijun)
senkouB = middle(ssb_bars)

// Plot Ichimoku Cloud
plot(tenkan, color=#0496ff, title="Tenkan-Sen")
plot(kijun, color=#991515, title="Kijun-Sen")
plot(close, offset=-cs_offset+1, color=#459915, title="Chikou-Span")
sa=plot(senkouA, offset=ss_offset-1, color=color.green, title="Senkou-Span A")
sb=plot(senkouB, offset=ss_offset-1, color=color.red, title="Senkou-Span B")
fill(sa, sb, color = senkouA > senkouB ? color.green : color.red, title="Cloud color")

ss_high = math.max(senkouA[ss_offset-1], senkouB[ss_offset-1])
ss_low = math.min(senkouA[ss_offset-1], senkouB[ss_offset-1])

// Entry/Exit Conditions
tk_cross_bull = tenkan > kijun
tk_cross_bear = tenkan < kijun
cs_cross_bull = ta.mom(close, cs_offset-1) > 0
cs_cross_bear = ta.mom(close, cs_offset-1) < 0
price_above_kumo = close > ss_high
price_below_kumo = close < ss_low


//Bollinger Bands Indicator
length = input.int(20, minval=1)
src = input(close, title="Source")
mult = input.float(2.0, minval=0.001, maxval=50, title="StdDev")
basis = ta.sma(src, length)
dev = mult * ta.stdev(src, length)
upper = basis + dev
lower = basis - dev
offset = input.int(0, "Offset", minval = -500, maxval = 500)
plot(basis, "Basis", color=#FF6D00, offset = offset)
p1 = plot(upper, "Upper", color=#2962FF, offset = offset)
p2 = plot(lower, "Lower", color=#2962FF, offset = offset)
fill(p1, p2, title = "Background", color=color.rgb(33, 150, 243, 95))

bullish = tk_cross_bull and cs_cross_bull and price_above_kumo and ta.crossover(lower, close)
bearish = tk_cross_bear and cs_cross_bear and price_below_kumo and ta.crossover(close, lower)

strategy.entry('Long', strategy.long, when=bullish and long_entry and timePeriod)
strategy.close('Long', when=bearish and not short_entry)

strategy.entry('Short', strategy.short, when=bearish and short_entry and timePeriod)
strategy.close('Short', when=bullish and not long_entry)


//Works well on BTC 30m/1h (11.29%), ETH 2h (29.05%), MATIC 2h/30m (37.12%), AVAX 1h/2h (49.2%), SOL 45m (45.43%)


더 많은